Skip to content

fix(obj): store Upload assignee, assigneeDate, closeDate as plain values#177

Merged
deveaud-m merged 1 commit into
fossology:mainfrom
Valyrian-Code:fix/upload-attrs-tuple-bug
May 23, 2026
Merged

fix(obj): store Upload assignee, assigneeDate, closeDate as plain values#177
deveaud-m merged 1 commit into
fossology:mainfrom
Valyrian-Code:fix/upload-attrs-tuple-bug

Conversation

@Valyrian-Code
Copy link
Copy Markdown
Contributor

@Valyrian-Code Valyrian-Code commented May 18, 2026

Closes #175.

Trailing commas in Upload.__init__ stored assignee, assigneeDate, and closeDate as 1-tuples instead of plain values. The docstring types all three as string, and (None,) was always truthy — breaking the obvious if upload.assignee: check. Drop the commas.

Constructor-level regression test verifies both the assigned and unassigned cases for all three attributes.

Rebased on latest main to pick up the codecov-on-fork fix.

Copilot AI review requested due to automatic review settings May 18, 2026 14:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and closeDate directly in Upload.__init__.
  • Add a regression test covering assigned values and the unassigned assignee default.

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.

Comment thread tests/test_uploads.py
@Valyrian-Code Valyrian-Code force-pushed the fix/upload-attrs-tuple-bug branch from b8bfc96 to 2fbe145 Compare May 18, 2026 16:23
@Valyrian-Code
Copy link
Copy Markdown
Contributor Author

Hi @deveaud-m ,

I’ve provided a minimal patch for this PR. Could you please review it when you have a chance?

@Valyrian-Code
Copy link
Copy Markdown
Contributor Author

Valyrian-Code commented May 22, 2026

Hi @deveaud-m

Heads up: the failing Integration Tests job here isn't caused by this PR. The pytest run itself completes successfully (192 passed, 2 skipped, 5 xfailed, 2 xpassed); the failure is in the "upload codecoverage results only if we are on the repository fossology/fossology-python" step that runs afterwards:

poetry run codecov -t 
codecov: error: argument --token/-t: expected one argument
##[error]Process completed with exit code 2.

The step's -t ${{ secrets.CODECOV_TOKEN }} substitutes to an empty value on fork PRs (secrets aren't passed to fork workflows), and the codecov CLI then exits non-zero, which fails the whole job. The step's intent appears to be "skip on forks" per its name, but the current conditional doesn't actually prevent it from running.

Happy to leave this for you to handle on the workflow side — just flagging so you don't have to dig.

@deveaud-m
Copy link
Copy Markdown
Collaborator

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>
@Valyrian-Code Valyrian-Code force-pushed the fix/upload-attrs-tuple-bug branch from 2fbe145 to d0d5e9e Compare May 22, 2026 22:18
@Valyrian-Code
Copy link
Copy Markdown
Contributor Author

Hi @deveaud-m (Thank you for the review)

Updates

  • Rebased on the latest main
  • Included the codecov-on-fork fix from ba2676f
  • Updated the PR description to match the new AI-Assisted Contributions section in the README

Verification

  • Force-pushed the updated changes

@deveaud-m deveaud-m merged commit 9f0f5a0 into fossology:main May 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upload attributes assignee, assigneeDate, closeDate incorrectly stored as 1-tuples

3 participants