Skip to content

Validate organizations with batched GraphQL queries - #1360

Merged
mlinksva merged 1 commit into
gh-pagesfrom
gql
Nov 16, 2026
Merged

mlinksva merged 1 commit into
gh-pagesfrom
gql

Conversation

@mlinksva

Copy link
Copy Markdown
Contributor

Summary

  • Replace individual website requests with authenticated GraphQL batches of 50 organization lookups.
  • Preserve incremental PR/push checks and monthly/manual full scans.
  • Reject explicit per-entry NOT_FOUND errors, including personal accounts; retain inconclusive entries on API, transport, or malformed-response errors.
  • Handle partial GraphQL responses and report aggregate HTTP and lookup results without per-entry noise for inconclusive checks.
  • Supply the workflow GITHUB_TOKEN and require authentication when there are names to check.

Validation

  • bundle exec ruby test/ensure_orgs_test.rb: 11 tests, 132 assertions passing
  • bundle exec rubocop script/ensure-orgs test/ensure_orgs_test.rb
  • git diff --check
  • Live full scan on a disposable data copy: 1,984 names in 40 requests, all HTTP 200, no throttling; 1,976 valid organizations and 8 explicit NOT_FOUND results. Repository data was not modified by the scan.

Use authenticated sequential batches of 50 organization lookups, retaining incremental checks and response summaries. Reject explicit NOT_FOUND errors while retaining inconclusive entries, including partial responses. Add offline coverage for batching, authentication, and API failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 16, 2026 22:22
@mlinksva
mlinksva merged commit 60c89f9 into gh-pages Nov 16, 2026
10 checks passed
@mlinksva
mlinksva deleted the gql branch November 16, 2026 22:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The migration makes automatic YAML dataset deletions depend on batch-level and alias-scoped GraphQL error handling, requiring human review of partial-response and destructive-mutation interactions.

No open issues 🎉

What changed in this PR

This PR moves organization validation from individual website requests to authenticated GraphQL batches, while preserving incremental checks and full scans.

Changes:

  • Batch up to 50 organization lookups per request and report aggregate results.
  • Remove only entries with explicit per-entry NOT_FOUND errors; retain inconclusive results.
  • Supply the workflow token and update tests for batching, error handling, and authentication.
File Description
test/​ensure_orgs_test.rb Adds GraphQL response fixtures and tests for batching, failures, and authentication.
script/​ensure-orgs Implements authenticated batched lookups, partial-response handling, and aggregate reporting.
.github/​workflows/​ensure-orgs.yml Passes GITHUB_TOKEN to the organization validation script.

Review effort: Balanced (adaptive)

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