Skip to content

feat: repo_policy_sync - all in one mega PR - #4

Draft
AlexanderLanin wants to merge 13 commits into
mainfrom
sync
Draft

feat: repo_policy_sync - all in one mega PR#4
AlexanderLanin wants to merge 13 commits into
mainfrom
sync

Conversation

@AlexanderLanin

Copy link
Copy Markdown
Member

No description provided.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 run inside 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 thread repo_policy_sync/engine.py Outdated
Comment on lines +91 to +97
subprocess.run(
command,
cwd=root,
check=True,
capture_output=True,
text=True,
)
Comment thread repo_policy_sync/operations/synchronize_bazel_dependencies.py Outdated
Comment thread repo_policy_sync/github.py Outdated
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 thread repo_policy_sync/engine.py Outdated
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
)

This comment was marked as resolved.

@AlexanderLanin
AlexanderLanin marked this pull request as draft August 25, 2026 18:31
@AlexanderLanin

Copy link
Copy Markdown
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.

@AlexanderLanin AlexanderLanin changed the title feat: repo_policy_sync feat: repo_policy_sync - all in one mega PR Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants