Skip to content

fix(workflows): restore complete repository drift checks - #187

Merged
devantler merged 3 commits into
mainfrom
codex/restore-drift-schedule-144
Sep 8, 2026
Merged

devantler merged 3 commits into
mainfrom
codex/restore-drift-schedule-144

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

The repository drift check still stopped before comparing settings after its permission problem was resolved. This left declared repository settings without a working daily check.

What

Read omitted settings through GitHub’s second read-only API, verify both responses describe the same repository, and keep incomplete results from passing. Restore the daily check while preserving private-repository redaction and every declared setting.

Fixes #144

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

@devantler I will review the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6caf2a6f-2a84-4713-a987-98a74dc2dae2

📥 Commits

Reviewing files that changed from the base of the PR and between 6a2927f and 836da65.

📒 Files selected for processing (1)
  • tests/repository-drift.sh

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 14fcc01c-43f4-4726-94e7-36cfdf2afad8

📥 Commits

Reviewing files that changed from the base of the PR and between 1ea8e27 and 6a2927f.

📒 Files selected for processing (4)
  • .github/workflows/repository-drift-check.yaml
  • AGENTS.md
  • scripts/check-repository-drift.sh
  • tests/repository-drift.sh

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⚠️ CI failures not shown inline (2)

GitHub Actions: 🔍 Repository drift check / 0_🔍 Repository drift check.txt: 🔍 Repository drift check

Conclusion: failure

View job details

##[group]Run bash scripts/check-repository-drift.sh
 �[36;1mbash scripts/check-repository-drift.sh�[0m
 shell: /usr/bin/bash -e {0}
 env:
   GH_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 DRIFT world-at-ruin.allowMergeCommit: declared=false live=true
 DRIFT world-at-ruin.allowRebaseMerge: declared=false live=true
 repository-drift: declared and live GitHub state disagree (see DRIFT lines above)
 ##[error]Process completed with exit code 1.

GitHub Actions: 🔍 Repository drift check / 🔍 Repository drift check: 🔍 Repository drift check

Conclusion: failure

View job details

##[group]Run bash scripts/check-repository-drift.sh
 �[36;1mbash scripts/check-repository-drift.sh�[0m
 shell: /usr/bin/bash -e {0}
 env:
   GH_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 DRIFT world-at-ruin.allowMergeCommit: declared=false live=true
 DRIFT world-at-ruin.allowRebaseMerge: declared=false live=true
 repository-drift: declared and live GitHub state disagree (see DRIFT lines above)
 ##[error]Process completed with exit code 1.
🧰 Additional context used
📓 Path-based instructions (2)
Follow the coding guidelines and instructions defined in `AGENTS.md`.

📄 CodeRabbit inference engine (GEMINI.md)

Files:

  • AGENTS.md
Follow the instructions defined in `AGENTS.md`.

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • AGENTS.md
🪛 Shellcheck (0.11.0)
tests/repository-drift.sh

[warning] 286-287: Remove space after = if trying to assign a value (for empty string, use var='' ... ).

(SC1007)

scripts/check-repository-drift.sh

[info] 94-105: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


📝 Walkthrough

Walkthrough

The drift-check script validates REST repository data and completes omitted declared settings through GitHub GraphQL. It verifies response errors, types, repository identity, and visibility before comparison. The tests cover complete responses, fallback reads, false values, malformed data, transport failures, redaction, and unmapped settings. The workflow now runs daily at 05:17 UTC and on manual dispatch without requesting administrative read permission. Maintenance documentation reflects the updated behavior.

Priority: ➖ Normal — Impact reflects medium issue severity.

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 6a292

Repository drift checks now complete omitted settings through GraphQL, fail closed on invalid or incomplete data, preserve private-repository redaction, and run daily. The change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: restoring complete repository drift checks in the workflow.
Description check ✅ Passed The description directly explains the repository drift check failure, the GraphQL fallback, repository validation, incomplete-read handling, daily schedule, and linked issue #144.
Linked Issues check ✅ Passed The changes satisfy issue #144. They restore the daily schedule, complete omitted REST settings through GraphQL, verify repository identity and visibility, preserve existing REST values, reject incomp…
Out of Scope Changes check ✅ Passed The workflow, maintenance documentation, implementation, and tests all support the linked issue objectives. No unrelated code changes are identified.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Resolved the ancillary notes in the previous review at 836da65aac6ba46cacca7c1ca72245dc18406bea:

  • SC1007: explicitly quoted the empty fixture override. The complete drift regression suite passes, and ShellCheck no longer reports this warning.
  • SC2016: the GraphQL query deliberately retains literal $owner and $name variables; gh supplies their values separately. Shell expansion would change the query contract. The actual metadata-only App run completed this exact reader successfully.
  • Docstring coverage: the report explicitly marks both analyzed Bash functions as unsupported. It supplies no missing supported-language docstring, and the reader’s behavior and failure handling are documented in the source.
  • The live drift check reached its terminal comparison summary and correctly reported the two existing World at Ruin discrepancies tracked in world-at-ruin declares squash-only merges but live allows merge commits and rebase merges #141. This read-only production diagnostic is deliberately separate from PR CI; all current-head PR checks pass. No declared setting was removed to obtain that result.

body_findings=0-resolved@836da65

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== changed files ==='
git diff --name-status HEAD~1..HEAD

echo '=== current commit ==='
git rev-parse HEAD

echo '=== diff ==='
git diff --no-ext-diff --unified=80 HEAD~1..HEAD -- \
  .github/workflows/repository-drift-check.yaml \
  AGENTS.md \
  scripts/check-repository-drift.sh \
  tests/repository-drift.sh

echo '=== script outline ==='
ast-grep outline scripts/check-repository-drift.sh --items all || true

echo '=== relevant script symbols ==='
rg -n -A120 -B15 \
  '^(complete_repository_settings|main|compare_repository_settings)\s*\(\)|gh api graphql|declared|node_id|nameWithOwner|isPrivate' \
  scripts/check-repository-drift.sh

echo '=== test assertions around GraphQL and fixture behavior ==='
rg -n -A30 -B10 \
  'graphql|live_dir|incomplete|missing|partial|node_id|nameWithOwner|isPrivate' \
  tests/repository-drift.sh

Length of output: 34495


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD origin/master 2>/dev/null || true)"
echo "=== merge base ==="
printf '%s\n' "$base"

if [[ -n "$base" ]]; then
  echo '=== complete PR diff ==='
  git diff --no-ext-diff --unified=100 "$base..HEAD" -- \
    .github/workflows/repository-drift-check.yaml \
    AGENTS.md \
    scripts/check-repository-drift.sh \
    tests/repository-drift.sh
fi

echo '=== workflow ==='
cat -n .github/workflows/repository-drift-check.yaml

echo '=== test setup and script remainder ==='
sed -n '1,230p' tests/repository-drift.sh
sed -n '359,430p' tests/repository-drift.sh

echo '=== PR metadata ==='
gh pr view 187 --repo devantler-tech/.github \
  --json baseRefName,headRefName,commits,files \
  --jq '{baseRefName, headRefName, commits: [.commits[].oid], files: [.files[].path]}'

Length of output: 58788


@devantler Reviewed commit 836da65aac6ba46cacca7c1ca72245dc18406bea.

The GraphQL fallback preserves present REST values, validates both API identities and visibility, and fails closed for incomplete responses. The tests cover the relevant fallback, malformed-response, drift, and redaction paths.

I found no new actionable issues.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

The current-head CodeRabbit request returned an explicit review rate-limit refusal, so its accompanying prose does not clear the review gate. The prior ancillary notes are resolved in the preceding request; all current-head PR checks pass.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T10:08:43.147417Z 836da65 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Behaviour evaluated at 836da65aac6ba46cacca7c1ca72245dc18406bea:

The original main workflow aborted on an omitted REST setting after token creation succeeded. With the repaired reader, the actual metadata-only App run completed the whole comparison and returned exactly the two existing World at Ruin discrepancies tracked in #141. It reached the terminal drift summary with exit 1, rather than stopping with an incomplete-read exit 2; token creation and revocation both completed successfully.

The final commit only clarifies an empty test variable. Its executable reader and workflow blobs are identical to that exercised run. Current-head required CI passes, and the synthetic merge tree matches the locally computed merge against actual main 1ea8e27f68092d41509aa047aaf0ff708afee3f7.

As the operator of this check, the result is now actionable: every declared setting is compared, missing or mismatched API data remains an error, and private repository values remain withheld. The daily trigger is defined for 05:17 UTC; its first scheduled execution can only be observed after this change lands. The genuine repository-setting drift remains separate declarative work under #141.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 836da65aac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@devantler
devantler marked this pull request as ready for review September 8, 2026 10:09
@devantler
devantler merged commit a8ccdb3 into main Sep 8, 2026
14 checks passed
@devantler
devantler deleted the codex/restore-drift-schedule-144 branch September 8, 2026 10:12
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.

Grant the workflow App administrative read so the drift check can see repository settings

1 participant