🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

fix(core): generate reportID before templating - #10664

Merged
olblak merged 3 commits into
updatecli:mainfrom
olblak:fix/stable-report-id
Sep 29, 2026
Merged

olblak merged 3 commits into
updatecli:mainfrom
olblak:fix/stable-report-id

Conversation

@olblak

@olblak olblak commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

This pullrequest fix a situation where Updatecli would creates different report id for a same manifest using different dynamic values like in the autodiscovery situation

Test

To test this pull request, you can run the following commands:

cd pkg/core/pipeline
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.
  • I have tested this pull request manually with a custom Updatecli build and it works as expected.

Tradeoff

Potential improvement

Summary by CodeRabbit

  • Improvements
    • Report IDs remain stable when runtime-rendered values change during a pipeline run, while still reflecting the pipeline’s configured resources.
    • When configuration details cannot be extracted normally, available resource configuration is used to calculate the report ID.
    • Resource IDs continue to reflect their current configuration, even when the report ID is frozen.
    • Reports without a frozen ID continue to use the existing ID behavior, and reports without templates retain their existing ID.

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the bug Something isn't working label Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c277c362-d0fd-4491-abf2-2bdb4e29f8c9

📥 Commits

Reviewing files that changed from the base of the PR and between 0db2ab7 and 1b46bd2.

📒 Files selected for processing (2)
  • pkg/core/pipeline/main.go
  • pkg/core/pipeline/main_report_id_test.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

Report now computes IDs from the report name and resource configuration and SCM hashes. Pipeline initialization freezes the ID before graph generation and clears temporary raw configurations used when report-config extraction fails.

Changes

Stable Report ID

Layer / File(s) Summary
Report ID calculation and validation
pkg/core/reports/report.go, pkg/core/reports/report_id_test.go
Report computes resource configuration and SCM hashes and uses them to build the report ID. Tests cover repeated updates, frozen IDs after target configuration changes, and IDs for reports without templates.
Pipeline ID freezing
pkg/core/pipeline/main.go, pkg/core/pipeline/main_report_id_test.go
Pipeline.Init uses raw resource configuration when report-config extraction fails, freezes the report ID before graph generation, and clears the temporary raw configurations. Tests cover rendered target values and raw-config fallback.

Priority: ⚪ Not assessed

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant PipelineInit
  participant ResourceConfigs
  participant Report
  PipelineInit->>ResourceConfigs: Extract report configs or use raw configs
  PipelineInit->>Report: FreezeID before runtime rendering
  PipelineInit->>Report: Clear temporary raw configs
Loading

Merge Risk: ⚪ Minimal · up to 1b46b

This change keeps report IDs stable when dynamic values are rendered. No actionable merge-blocking risk was found in the supplied changes.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 1b46b

The changed report identity is intentionally stable across rendered values, and no new authorization bypass or credential exposure was established. Some downstream uses of that identity remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The resulting report ID reaches local YAML export paths and reports prepared for an optional experimental remote publisher. Whether the remote service treats it as an authorization or isolation key was not established.

Trust Boundaries and Controls

  • observed — When pre-render resource construction fails, Spec is excluded from the temporary hash input rather than retained in the report. No change to an authorization check was identified in the inspected initialization and report-ID path.

Resilience and Maintainability Implications

  • observed — The fallback test deliberately gives the same report ID to configurations differing only in an unresolved Spec, while a different resource kind gives a different ID. This demonstrates an identity limitation, not an established new cross-asset attack path.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 4 files. 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 describes the main change: generating the report ID before templating.
Description check ✅ Passed The description explains the report ID issue, provides a test command, and includes the required template sections. The issue reference is missing, and the Tradeoff and Potential improvement sections …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

Signed-off-by: Olblak <me@olblak.com>
@olblak
olblak merged commit 83a8bd0 into updatecli:main Sep 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant