Skip to content

fix(be): Add max history index proto fields - #23831

Draft
clickboo wants to merge 1 commit into
masterfrom
boo-history-index-protos
Draft

clickboo wants to merge 1 commit into
masterfrom
boo-history-index-protos

Conversation

@clickboo

@clickboo clickboo commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Description

First branch in the max history index stack. This PR adds storage and API fields only, plus the generated code for those fields.

max_history_index is the Dockerfile-history cut for instructions that have no content blob, such as USER, ENV, and CMD. max_layer_index stays the content-blob cut. Base images and base image tags can store config history, including those empty lines, so a later enrichment pass can check whether the base history is a prefix of the workload image.

Dockerfile-line policy filtering is not in this stack. This PR does not change runtime behavior.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

Schema and generated code only. No new tests.

How I validated my change

  • The diff against master is limited to proto/storage messages, proto/storage/proto.lock, and the generated Go and swagger files.
  • Those generated files are the ones already produced for these proto fields.

@openshift-ci

openshift-ci Bot commented Nov 3, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@clickboo

clickboo commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Base image information now includes ordered build-history entries, including instructions that did not create a content layer.
    • Image metadata can distinguish the last recorded build-history entry from the last content layer, preserving empty history lines when comparing base and derived images.

The storage schemas now record ordered base-image history entries, including entries without content blobs. BaseImageInfo adds an optional index for the final base history entry when base history is a strict prefix of child history.

Changes: Base-image history

Layer / File(s) Summary
Store base-image history
proto/storage/base_image.proto, proto/storage/base_image_repository.proto
BaseImage and BaseImageTag gain ordered history fields that use BaseImageHistoryEntry. Each entry contains an instruction, a value, and an empty-content flag. The fields are excluded from search and SQL mappings.
Define the history boundary
proto/storage/image.proto
BaseImageInfo adds presence-aware max_history_index. The documentation defines its use when base history is a strict prefix of image history. When unset, Dockerfile-line filtering must not cut history. max_layer_index refers to the last base content-blob manifest index.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: ajheflin, alkmim

Merge Risk: Minimal · previous review 80048

The schema adds history storage and an optional boundary without changing filtering. No merge-blocking risk is identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: adding max history index fields to the backend proto definitions. It is concise and related to the changeset.
Description check Passed The description explains the purpose, scope, data model, runtime impact, documentation status, testing status, and validation method. It also explains why no new tests were added for this schema and g…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Description check

Explanation

The description explains the purpose, scope, data model, runtime impact, documentation status, testing status, and validation method. It also explains why no new tests were added for this schema and generated-code-only change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8146fb05-dae8-499f-ad8e-214c443b8497
Commits

Reviewing files that changed from the base of the PR and between d152951 and 800482b.

Files ignored due to path filters: 9
  • generated/api/v1/image_service.swagger.json is excluded by !**/generated/**
  • generated/api/v1/vuln_mgmt_service.swagger.json is excluded by !**/generated/**
  • generated/storage/base_image.pb.go is excluded by !**/*.pb.go, !**/generated/**
  • generated/storage/base_image_repository.pb.go is excluded by !**/*.pb.go, !**/generated/**
  • generated/storage/base_image_repository_vtproto.pb.go is excluded by !**/*.pb.go, !**/generated/**
  • generated/storage/base_image_vtproto.pb.go is excluded by !**/*.pb.go, !**/generated/**
  • generated/storage/image.pb.go is excluded by !**/*.pb.go, !**/generated/**
  • generated/storage/image_vtproto.pb.go is excluded by !**/*.pb.go, !**/generated/**
  • proto/storage/proto.lock is excluded by !**/*.lock
Files selected for processing: 3
  • proto/storage/base_image.proto
  • proto/storage/base_image_repository.proto
  • proto/storage/image.proto

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

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit 56abc9c. To use with deploy scripts:

export MAIN_IMAGE_TAG=5.1.x-462-g56abc9c2c6

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.57%. Comparing base (cc3d9a7) to head (56abc9c).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #23831      +/-   ##
==========================================
- Coverage   52.61%   52.57%   -0.04%     
==========================================
  Files        2836     2836              
  Lines      177975   177975              
==========================================
- Hits        93642    93574      -68     
- Misses      76140    76187      +47     
- Partials     8193     8214      +21     
Flag Coverage Δ
go-unit-tests 52.57% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@clickboo

clickboo commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/test all

@openshift-ci

openshift-ci Bot commented Nov 3, 2026

Copy link
Copy Markdown

@clickboo: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocp-next-candidate-ui-e2e-tests d152951 link false /test ocp-next-candidate-ui-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@clickboo
clickboo force-pushed the boo-history-index-protos branch from d152951 to 800482b Compare November 3, 2026 18:02
Co-authored-by: Cursor <cursoragent@cursor.com>
@clickboo
clickboo force-pushed the boo-history-index-protos branch from 800482b to 56abc9c Compare November 3, 2026 20:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant