fix(obj): store Upload assignee, assigneeDate, closeDate as plain values#177
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes Upload metadata fields so assignee-related attributes are stored as plain values instead of accidental 1-tuples, matching the intended object model and issue #175.
Changes:
- Assign
assignee,assigneeDate, andcloseDatedirectly inUpload.__init__. - Add a regression test covering assigned values and the unassigned
assigneedefault.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
fossology/obj.py |
Removes tuple wrapping from three Upload attributes. |
tests/test_uploads.py |
Adds constructor-level regression coverage for upload assignee fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b8bfc96 to
2fbe145
Compare
|
Hi @deveaud-m , I’ve provided a minimal patch for this PR. Could you please review it when you have a chance? |
|
Hi @deveaud-m Heads up: the failing Integration Tests job here isn't caused by this PR. The pytest run itself completes successfully ( The step's Happy to leave this for you to handle on the workflow side — just flagging so you don't have to dig. |
|
Please rebase on top of main to make sure the pipeline is successful even in case of a fork and align the PR description according to the guidelines added for AI-assisted coding in the README. |
Trailing commas in Upload.__init__ wrapped these three attributes in
1-tuples instead of assigning the values directly. The docstring types
all three as string. Drop the commas so the attributes match the
documented behaviour.
Without this fix `upload.assignee` returned `("username",)` (or
`(None,)` when unassigned), which is always truthy and breaks any
caller that compares or formats the value as a string.
Adds a constructor-level regression test for the assigned and
unassigned cases.
Closes fossology#175
Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
2fbe145 to
d0d5e9e
Compare
|
Hi @deveaud-m (Thank you for the review) Updates
Verification
|
Closes #175.
Trailing commas in
Upload.__init__storedassignee,assigneeDate, andcloseDateas 1-tuples instead of plain values. The docstring types all three asstring, and(None,)was always truthy — breaking the obviousif upload.assignee:check. Drop the commas.Constructor-level regression test verifies both the assigned and unassigned cases for all three attributes.
Rebased on latest
mainto pick up the codecov-on-fork fix.