feat: repo_policy_sync - all in one mega PR - #4
Draft
AlexanderLanin wants to merge 13 commits into
Draft
Conversation
AlexanderLanin
force-pushed
the
sync
branch
3 times, most recently
from
August 25, 2026 06:59
79bb0d9 to
5dfbed1
Compare
AlexanderLanin
marked this pull request as ready for review
August 25, 2026 14:08
AlexanderLanin
requested review from
MaximilianSoerenPollak,
dcalavrezo-qorix and
nradakovic
as code owners
August 25, 2026 14:08
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 156 out of 157 changed files in this pull request and generated 4 comments.
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
.github/workflows/tests.yml:48
- This is not an isolated wheel smoke test:
uv runinside the project includes the current project environment by default, so the entry point or imports can resolve from the checkout and hide missing wheel contents. Use--no-project, and smoke-test both newly declared console scripts from the built artifact.
- name: Smoke-test the installed Repository Policy Sync CLI
run: uv run --with dist/*.whl score-repo-policy-sync --help
repo_policy_sync/github.py:342
- The same helper handles open and merged PR queries, but an unowned historical merged PR on this branch is treated as a fatal ownership violation. That permanently breaks JSON/Markdown status reporting even though merged history is read-only. Keep the refusal for an open branch, but ignore unowned merged PRs when selecting policy history.
if accepted_marker not in body:
raise CommandError(
f"refusing to reuse {repository} branch {branch}: its {state} pull request "
f"is not owned by policy {policy_id}"
)
repo_policy_sync/operations/synchronize_file.py:378
- Job discovery assumes exactly two spaces of indentation. Valid workflows using four-space job indentation are not recognized; the merge then appends the source job, and the collision check misses an existing job with the same ID, producing duplicate YAML keys and an invalid workflow. Determine the immediate child indentation under
jobs:instead of hard-coding two spaces; nested permission detection has the same issue.
Comment on lines
+91
to
+97
| subprocess.run( | ||
| command, | ||
| cwd=root, | ||
| check=True, | ||
| capture_output=True, | ||
| text=True, | ||
| ) |
Comment on lines
+667
to
+670
| def close_pull_request(self, *, repository: str, pull_request: PullRequest) -> None: | ||
| """Close a policy-owned pull request after ownership is verified.""" | ||
|
|
||
| self._run(["gh", "pr", "close", pull_request.url, "--repo", repository]) |
Comment on lines
+138
to
+145
| for call in _BAZEL_DEP_CALL.finditer(text): | ||
| name_match = _NAME_ARGUMENT.search(call.group(1)) | ||
| if name_match is None: | ||
| continue | ||
| version_match = _VERSION_ARGUMENT.search(call.group(1)) | ||
| dependencies[name_match.group(1)] = ( | ||
| parse_bazel_version(version_match.group(1)) if version_match else None | ||
| ) |
AlexanderLanin
marked this pull request as draft
August 25, 2026 18:31
Member
Author
|
this is just too big, and impossible to get a clear version here. I'll keep this branch, and start a new one with only like 2 policies. To get the framework agreed and merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.