Skip to content

Create configs when untracked repos found - #2630

Merged
marcoieni merged 2 commits into
rust-lang:mainfrom
cuba0001:untracked-repos
Aug 5, 2026
Merged

Create configs when untracked repos found#2630
marcoieni merged 2 commits into
rust-lang:mainfrom
cuba0001:untracked-repos

Conversation

@cuba0001

@cuba0001 cuba0001 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

Copy link
Copy Markdown
Dry-run check results

[WARN  rust_team::sync] sync-team is running in dry mode, no changes will be applied.
[INFO  rust_team::sync] synchronizing crates-io
[INFO  rust_team::sync] synchronizing github

@Kobzol Kobzol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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=$(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The branch name is a constant, same as in josh-sync. I don't think we need this lookup complexity.

  1. Run the team command and check if any TOML file was generated, according to its exit code
  2. If yes, create the new branch, add the TOML files, commit it, and push to the branch
  3. If a PR does not exist at the moment, create it from that branch

@cuba0001 cuba0001 Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@jieyouxu jieyouxu added needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin. labels Jul 26, 2026

@marcoieni marcoieni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some initial comments. The first two detected with AI. All fixed with AI.

Comment thread .github/workflows/check-untracked-repos.yml Outdated
Comment thread .github/workflows/check-untracked-repos.yml Outdated
Comment thread .github/workflows/check-untracked-repos.yml Outdated
@marcoieni marcoieni self-assigned this Jul 30, 2026
@cuba0001

Copy link
Copy Markdown
Contributor Author

some initial comments. The first two detected with AI. All fixed with AI.

Made the commit including these improvements.

@marcoieni marcoieni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fix token name

Comment thread .github/workflows/check-untracked-repos.yml Outdated
Comment thread .github/workflows/check-untracked-repos.yml Outdated
Comment thread .github/workflows/check-untracked-repos.yml Outdated
Comment thread src/main.rs Outdated
Comment thread src/ci.rs Outdated
Comment thread src/ci.rs Outdated
Comment thread src/ci.rs Outdated
Comment thread src/ci.rs Outdated
@rustbot

This comment has been minimized.

@rustbot

rustbot commented Aug 4, 2026

Copy link
Copy Markdown

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.

@cuba0001

cuba0001 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@marcoieni
Sorry for the dealy. I force-pushed improvements.

@marcoieni
marcoieni added this pull request to the merge queue Aug 5, 2026
Merged via the queue into rust-lang:main with commit 97f017f Aug 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants