New package handling #108

Open
adamm wants to merge 25 commits from new-packages into main
Owner

Depends on #106

Depends on https://src.opensuse.org/git-workflow/autogits/pulls/106
adamm added 21 commits 2026-01-12 15:13:32 +01:00
- Add scenarios for closed/merged project PRs that trigger
   submodule checks and downstream PR updates (manual merge vs close).
- Test the "Consistency check" logic where submodules are reset
  if they don't match the PR set.
- Test the "superfluous PR" check (no-op PRs that should be closed).
- PullRequestWebhookEvent: Verified that PR events correctly
  trigger processing with all necessary Gitea and Git mocks.
- IssueCommentWebhookEvent: Verified that issue comment events
  (which Gitea often uses for PR comments) are handled correctly.
- Recursion Limit: Verified that the recursion protection logic
  correctly terminates and cleans up when the limit is reached.
- Invalid Data Format: Verified that non-event data types return
  appropriate errors.
- Uncomment and fix the existing tests for `synchronized` actions.
- Ensure it uses the new `PullRequestProcessor` interface and mocked dependencies.
Also,
- Add simple unit tests to verify mapping of `models.StateType`
  to internal event strings.
- Verify it correctly wraps `ProcesPullRequest` and handles panics
  via the deferred recovery block.
- Add tests for scenarios where `GetRecentPullRequests` fails.
- Verify the random sleep interval logic (can be tested by mocking
  `time.Sleep` if refactored, or verifying behavior with interval=0).
- Add a test case specifically verifying that `Gitea.SetLabels`
  is called with `staging/Auto` when a *new* project PR is created
  for submodules.
- Verify `PrjGitDescription` and `SetSubmodulesToMatchPRSet` behave
  correctly when a single `PRSet` contains 5+ different package
  repositories.
pr: move interfaces and mocks to parent package
Some checks failed
go-generate-check / go-generate-check (pull_request) Failing after 22s
18f7ed658a
pr: interfaces moved to main package
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 7s
f959684540
TZ needs to be defined, otherwise it was assumed to be local which
then resulted in unpredictable commit hashes. We define it to UTC
for unit tests

PR have state "open" not "opened"
pr: make sure new repos have fork/parent relationship
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 23s
b689aafa7f
If new target repo is "reparented", it will have correct relationship
here. Otherwise PR creation will fail
adamm added 2 commits 2026-01-18 23:33:21 +01:00
pr: fix tests
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 25s
a0d554caaf
adamm added 3 commits 2026-01-26 11:57:32 +01:00
If issue is a SHA ref, and then it's updated, we need to make
sure that the branch is also updated.
common: add test for directory listing
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 9s
4c9c2a20f3
adamm added 3 commits 2026-01-27 14:07:55 +01:00
pr: fix tests
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 8s
80d4e83f30
adamm added 2 commits 2026-01-28 09:16:26 +01:00
pr: no need to create PR if already exists.
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 8s
9922b05942
adamm changed title from New package handling -- stacked with previous PR tests to New package handling 2026-01-28 09:20:32 +01:00
adamm force-pushed new-packages from 9922b05942 to 98ac879aa6 2026-01-28 11:20:37 +01:00 Compare
adamm added 1 commit 2026-01-28 16:12:49 +01:00
pr: close associated PR if issue closed.
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 8s
1fd14b1904
adamm added 1 commit 2026-01-29 10:21:56 +01:00
pr: small refactor
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 9s
39ca3fcf42
adamm added 3 commits 2026-01-29 18:06:55 +01:00
pr: small refactor
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 8s
a010537a14
adamm force-pushed new-packages from a010537a14 to 4790ee3096 2026-01-30 16:44:20 +01:00 Compare
adamm added 2 commits 2026-01-31 10:18:55 +01:00
Use test logger when running under a test.
common: replace legacy logger with standard impl
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 27s
f47da62481
adamm added 1 commit 2026-02-01 20:35:45 +01:00
pr: Always allow maintainer edits in new packages
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 25s
9b3d6e9a66
adamm requested review from jzerebecki 2026-02-04 14:21:10 +01:00
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 25s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin new-packages:new-packages
git checkout new-packages
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: git-workflow/autogits#108