Skip to content

Conversation

@amcmahon-rh
Copy link
Contributor

When cancelling a task there is no recorded information of who cancelled the task, simply that it was cancelled. This is unhelpful to users if someone else cancels their task or push.

This change adds in the components for being able to show which user cancelled the task.

When cancelling a task there is no recorded information of who cancelled
the task, simply that it was cancelled. This is unhelpful to users if
someone else cancels their task or push.

This change adds in the components for being able to show which user
cancelled the task.
@amcmahon-rh amcmahon-rh merged commit 73d3e58 into release-engineering:master Mar 24, 2025
19 checks passed
@kdudka
Copy link
Contributor

kdudka commented Mar 26, 2025

The upstream CI of OpenScanHub uses the HEAD of this repository. After this pull request was merged, the CI started to fail with:

+ osh/hub/manage.py migrate
SystemCheckError: System check identified some issues:

ERRORS:
hub.Task.cancelled_by: (fields.E304) Reverse accessor 'User.task_set' for 'hub.Task.cancelled_by' clashes with reverse accessor for 'hub.Task.owner'.
	HINT: Add or change a related_name argument to the definition for 'hub.Task.cancelled_by' or 'hub.Task.owner'.
hub.Task.owner: (fields.E304) Reverse accessor 'User.task_set' for 'hub.Task.owner' clashes with reverse accessor for 'hub.Task.cancelled_by'.
	HINT: Add or change a related_name argument to the definition for 'hub.Task.owner' or 'hub.Task.cancelled_by'.

If I pin kobo to 0.39.0, the CI failure goes away. Do we need to take some extra steps to migrate our application to the updated snapshot of kobo?

@kdudka
Copy link
Contributor

kdudka commented Mar 27, 2025

@amcmahon-rh @rbikar Any explanation for the above mentioned consequences?

kdudka added a commit to kdudka/kobo that referenced this pull request Mar 27, 2025
... to keep the nomenclature consistent with the `CANCELED` state.

Related: release-engineering#271
kdudka added a commit to kdudka/kobo that referenced this pull request Mar 27, 2025
... to eliminate the following failure while applying migrations:
```
+ osh/hub/manage.py migrate
SystemCheckError: System check identified some issues:

ERRORS:
hub.Task.cancelled_by: (fields.E304) Reverse accessor 'User.task_set' for 'hub.Task.cancelled_by' clashes with reverse accessor for 'hub.Task.owner'.
	HINT: Add or change a related_name argument to the definition for 'hub.Task.cancelled_by' or 'hub.Task.owner'.
hub.Task.owner: (fields.E304) Reverse accessor 'User.task_set' for 'hub.Task.owner' clashes with reverse accessor for 'hub.Task.cancelled_by'.
	HINT: Add or change a related_name argument to the definition for 'hub.Task.owner' or 'hub.Task.cancelled_by'.
```

Related: release-engineering#271
Related: openscanhub/openscanhub#317
Closes: release-engineering#273
@kdudka
Copy link
Contributor

kdudka commented Mar 27, 2025

I have submitted #273 to fix this.

@rbikar
Copy link
Member

rbikar commented Mar 27, 2025

I asked privately @amcmahon-rh to have a look, but I guess he hasn't had a chance to fix it.

@amcmahon-rh
Copy link
Contributor Author

amcmahon-rh commented Mar 27, 2025

Heyo, I was looking at it and had a PR ready to open, but Kamil beat me to it.

I was thinking of using the "+" to tell Django not to create a reverse relationship (the user not having access to tasks they cancelled), but I think having the same sort of related_name field like we've used for other foreign keys will be good for consistency.

Edit: I am a bit surprised there was an issue though. Before merging this PR, I tested the migrations on a pub pod locally, and it appeared to run fine.

@kdudka
Copy link
Contributor

kdudka commented Mar 27, 2025

The OSH CI runs tests on el8/el9 using the python3-django3 packages from EPEL. So I guess that made the difference.

amcmahon-rh added a commit that referenced this pull request Mar 31, 2025
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.

3 participants