Create configs when untracked repos found - #2630
Conversation
cf667d1 to
9d2859e
Compare
Dry-run check results |
Kobzol
left a comment
There was a problem hiding this comment.
Hi, thanks for the PR! I quickly glanced at the YAML file only, left one comment.
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} # this one is generated by GHA | ||
| run: | | ||
| EXISTING_PULL_REQUEST_BRANCH=$( |
There was a problem hiding this comment.
The branch name is a constant, same as in josh-sync. I don't think we need this lookup complexity.
- Run the
teamcommand and check if any TOML file was generated, according to its exit code - If yes, create the new branch, add the TOML files, commit it, and push to the branch
- If a PR does not exist at the moment, create it from that branch
There was a problem hiding this comment.
Just to clarify. Should the team command run from the automation branch or from main? This was the main point I was unsure about.
If we run it from main, there is a problem. If an infra-admin makes changes between the first and second workflow runs, those changes will be overwritten because we would have to force-push the branch, as each run would detect the same untracked repositories again (not the same for automation branch, because missing configs are already commited).
Is this ok?
As for dynamic branch name, I added it to avoid making the same branch actual in every workflow run, since it could fall far behind main if nobody rebases it or something.
There was a problem hiding this comment.
I'd say that it should always run from main. If there is a diff, then force push to the branch. If there is no diff, and a PR is open, then close the PR (unless that somehow prevents us from opening a PR from the same branch in the future).
There was a problem hiding this comment.
Done. It force pushes the automation branch if PR exists, its name is constant. Also, deletes PRs which are open and there is no diff.
9d2859e to
5c9b981
Compare
marcoieni
left a comment
There was a problem hiding this comment.
some initial comments. The first two detected with AI. All fixed with AI.
dbc80c3 to
49562a5
Compare
Made the commit including these improvements. |
This comment has been minimized.
This comment has been minimized.
49562a5 to
1c1e7fa
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@marcoieni |
Related to #2582
According to the discussion in the previous #2611 it creates missing toml files. I added an exit code 2 to signal that untracked repos are found and configs are created, because this is the simplest way for the workflow to handle it. This still keeps code 1 for unexpected errors.