Skip to content

fix: keep Pages view when policy report fetch fails - #116

Merged
AlexanderLanin merged 3 commits into
mainfrom
fix/policy-report-fetch-failure
Oct 6, 2026
Merged

AlexanderLanin merged 3 commits into
mainfrom
fix/policy-report-fetch-failure

Conversation

@AlexanderLanin

Copy link
Copy Markdown
Member

Why

A missing policy-sync artifact currently allows the Pages workflow to publish a dashboard without the policy-sync view. Failing the refresh preserves the existing deployed site until a complete view can be produced.

Changes

  • Make fetch-policy-report fail when the configured report is unavailable, stopping the Pages refresh before it publishes an incomplete dashboard.
  • Log the selected workflow run and, after a download failure, report the artifacts attached to that run, including expiration status and size. If the expected file is missing after download, log the downloaded filenames.
  • Document the required report behavior.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:07

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.

Copilot review overview

🟡 Changes recommended

The deployment-blocking exit behavior and new diagnostic path need automated test coverage.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Updates policy-report fetching so Pages deployment stops when a complete policy view cannot be produced.

Changes:

  • Fails the CLI command when the report is unavailable.
  • Adds workflow-run and artifact diagnostics.
  • Documents the required-report behavior.
File Description
src/​generate_repo_overview/​policy_sync.py Adds fetch diagnostics and artifact details.
src/​generate_repo_overview/​cli.py Returns failure when fetching fails.
docs/​repo-overview/​usage-and-extension.md Documents failure semantics.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/generate_repo_overview/cli.py
Comment thread src/generate_repo_overview/policy_sync.py
Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:09

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.

Copilot review overview

🔵 Needs a closer look

Artifact diagnostics omit paginated results, and the publication-blocking failure path lacks regression coverage.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Artifacts endpoint reads only the first page

src/​generate_repo_overview/​policy_sync.py:363

The artifacts endpoint is paginated, but this request reads only its first page (30 artifacts by default). A run with more artifacts can therefore produce an incomplete diagnostic and omit the expected artifact. Paginate and slurp the page objects before selecting their artifact entries.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:12

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.

Copilot review overview

🟡 Changes recommended

The downloaded-filenames diagnostic lacks coverage despite being an explicit new behavior.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)

Comment thread src/generate_repo_overview/policy_sync.py
Comment on lines +314 to +318
downloaded_files = sorted(
str(path.relative_to(download_dir))
for path in Path(download_dir).rglob("*")
if path.is_file()
)

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.

If you download stuff here ,is there any possibility of it being thigns we do not want to leak?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

you mean private stuff? like if you have private policies that you do not show in your overview page? Then dont tell it where to dowload the report.

@MaximilianSoerenPollak MaximilianSoerenPollak 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.

Seems alright, question answered.

Issue / Bug was demonstrated.

@AlexanderLanin
AlexanderLanin merged commit beb89c3 into main Oct 6, 2026
7 checks passed
@AlexanderLanin
AlexanderLanin deleted the fix/policy-report-fetch-failure branch October 6, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants