fix: add admin pull request state reconciliation endpoint#900
fix: add admin pull request state reconciliation endpoint#900mertilginoglu wants to merge 3 commits intostagingfrom
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
40460dc to
6191669
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17e6515db6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
...r/src/main/java/de/tum/cit/aet/helios/pullrequest/PullRequestStateReconciliationService.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/de/tum/cit/aet/helios/pullrequest/PullRequestStateReconciliationService.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/de/tum/cit/aet/helios/pullrequest/PullRequestStateReconciliationService.java
Outdated
Show resolved
Hide resolved
|
I have a general comment: In local tests, I got 403 first. Then, I realized that admin authorization requires X-Repository-Id header, so we will get 403 without it even if we have admin access rights. It would be good to document it for next developers. Maybe we can also think about an Admin Dashboard for such operations. |
I added a new service to check repository related authorization. I noticed that in previous case admins in different repos can run this endpoint also for other repositories. |
c888f57 to
de3eaa2
Compare
Motivation
Open pull requests can remain stale in Helios when GitHub state changes are missed or delayed. This makes the local PR state unreliable for reviewers and administrators and makes it harder to recover from synchronization gaps.
Description
Testing Instructions
Prerequisites:
Flow:
/api/pullrequests/repository/{repositoryId}/reconcile-stateand verify the request is rejected with 403 Forbidden./api/pullrequests/repository/{repositoryId}/reconcile-state?dryRun=trueand verify the response contains reconciliation statistics without modifying data./api/pullrequests/repository/{repositoryId}/reconcile-stateas an admin user and verify that pull requests which are locally open but already closed on GitHub are reconciled correctly.Checklist
General
Server