Skip to content

fix(ingest_policy): skip 403/HTTP errors per policy instead of crashing#441

Merged
talhaahmad-supp merged 1 commit into
masterfrom
fix/ingest-policy-403-error-handling
Jun 24, 2026
Merged

fix(ingest_policy): skip 403/HTTP errors per policy instead of crashing#441
talhaahmad-supp merged 1 commit into
masterfrom
fix/ingest-policy-403-error-handling

Conversation

@talhaahmad-supp

@talhaahmad-supp talhaahmad-supp commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ingest_policy.py called res.raise_for_status() unconditionally inside the per-policy loops, so a single 403 (or any HTTP error) on one policy endpoint aborted the entire run and left the workflow in error state
  • Wrapped raise_for_status() in try/except requests.exceptions.HTTPError in all three affected functions: get_all_policy_with_permission, get_all_policy_with_column_permission, get_all_assign_users
  • Inaccessible policies are now logged and skipped; all accessible policies continue to be ingested normally

Test plan

  • Confirm the script completes successfully when at least one policy returns 403 — skipped policies appear in logs, accessible ones are ingested
  • Confirm normal (all-200) runs are unaffected
  • Verify initial_ingest_policy and incremental_ingest_policy tasks no longer error on accounts where the API key lacks access to some policy endpoints

🤖 Generated with Claude Code

A single inaccessible policy endpoint was aborting the entire ingest run.
Wrap raise_for_status() in try/except in all three per-policy fetch
functions so failures are logged and skipped, letting the loop continue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@talhaahmad-supp talhaahmad-supp requested a review from a team as a code owner June 24, 2026 12:20

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

LGTM!

@talhaahmad-supp talhaahmad-supp merged commit 3590b91 into master Jun 24, 2026
3 checks passed
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