← Back to Pull requests

Allow setting an AWS account ID or external ID that was not configured before when updating a catalog #6211

Open
unknown opened this pull request with 319 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 26, 2026 00:16 UTC
Author

Fixes #6202

Why


The description of ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES says that, with the flag disabled (the default), "new values can be set when none were previously configured, but existing values cannot be changed to different ones".
The first half was not implemented: validateUpdateCatalogDiffOrThrow compared the current and new AWS account ID and external ID with Objects.equals, so a catalog created without a role ARN or without an external ID could never have one added later. The update failed with 400 Cannot modify ExternalId ... or 400 Cannot modify AWS account ID ....

This was also noted in the dev@ thread "[DISCUSS] Expand immutable-field validation for catalog storage config updates" as worth fixing on its own.

What changes


- PolarisAdminService.validateUpdateCatalogDiffOrThrow: the AWS account ID and external ID checks only reject a change when a value was configured before. Changing or removing an existing value is still rejected unless the flag is enabled.
- Azure tenantId is unaffected because it is a required field, so there is no null-to-value case.
- ManagementServiceTest: two new tests, setting an external ID and setting a role ARN on a catalog that had none. Both failed with the 400s above before the change. The existing tests for rejecting changes to configured values are unchanged and still pass.
- Changelog fragment under changelog.d/.

No documentation change: the flag description already states the intended behavior, and the generated flag reference is derived from it.

Testing


./gradlew format compileAll and ./gradlew :polaris-runtime-service:check (unit tests pass; the only failures were the Floci S3 virtual-host integration variants that do not run on macOS).

Checklist


  • 🙋 I am the human author: I understand this change and can explain it

  • 🛡 Don't disclose security issues! (contact security@apache.org)

  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #6202

  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)

  • 💡 Added comments for complex logic

  • 🧾 Added a changelog entry in changelog.d/ (if needed, see changelog.d/README.md)

  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

  • 🤖 Disclosed significant AI usage (recommended if AI was used, see CONTRIBUTING.md)
  • The fix, the two tests and the changelog fragment were drafted with Claude Code 2.1.323 (Claude Opus 5.5); I reviewed and tested all of it.

    Diff: 319 lines (+239 / -80) across 3 files Reviewer: youngrae81 Review duration: 7861m
    All Vouch review confidence checks passed
    Residual risk 0.36 = Change Risk (0.64) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.64 · 319 lines diff across 3 files
    0.64
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.345
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.064
    Real PR Conversation Timeline
    1 comments
    "Review active on #6211"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 43.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 63.6% (MEDIUM) · Higher = larger blast radius
    63.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 36.3% · Moderate risk
    36.3%
    Repository