Skip to content

Conversation

@nikpivkin
Copy link
Contributor

Description

This PR refactors the handling of IaC values in the iac/types package. A new generic BaseValue structure is introduced, serving as a universal container for storing a value along with its metadata. It centralizes all core logic for working with values, including JSON serialization and Rego conversion.

Typed values (StringValue, BoolValue, TimeValue, etc.) remain and can override behavior, for example TimeValue.ToRego, as well as provide domain-specific methods like StringValue.StartsWith or StringValue.Contains.

Constructors are preserved for convenient and safe creation of values, while invariants such as Default, Explicit, and Unresolvable are centrally enforced through BaseValue.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@nikpivkin nikpivkin added the autoready Automatically mark PR as ready for review when all checks pass label Dec 24, 2025
@github-actions github-actions bot added the apidiff Indicates Go API changes relevant to library consumers (CLI compatibility may be unaffected) label Dec 24, 2025
@github-actions
Copy link

github-actions bot commented Dec 24, 2025

📊 API Changes Detected

Semver impact: major

github.com/aquasecurity/trivy/pkg/iac/types
  Incompatible changes:
  - BaseAttribute: removed
  - BoolValue.BaseAttribute: removed
  - BytesValue.BaseAttribute: removed
  - IntFromInt32: removed
  - IntValue.BaseAttribute: removed
  - MapValue.BaseAttribute: removed
  - StringValue.BaseAttribute: removed
  - TimeValue.BaseAttribute: removed
  Compatible changes:
  - BaseValue: added
  - BoolValue.BaseValue: added
  - BytesValue.BaseValue: added
  - IntValue.BaseValue: added
  - MapValue.BaseValue: added
  - RFC3339Time: added
  - StringValue.BaseValue: added
  - TimeValue.BaseValue: added

@aqua-bot aqua-bot requested a review from a team December 24, 2025 10:30
@github-actions github-actions bot marked this pull request as ready for review December 24, 2025 10:50
@github-actions github-actions bot removed the autoready Automatically mark PR as ready for review when all checks pass label Dec 24, 2025
@github-actions github-actions bot requested a review from simar7 as a code owner December 24, 2025 10:50
@nikpivkin nikpivkin removed the request for review from a team December 24, 2025 11:25
@nikpivkin nikpivkin removed the apidiff Indicates Go API changes relevant to library consumers (CLI compatibility may be unaffected) label Dec 24, 2025
@simar7 simar7 added this pull request to the merge queue Jan 14, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 14, 2026
@nikpivkin nikpivkin force-pushed the refactor/iac-values branch from 0dbc09e to 675efde Compare January 15, 2026 13:39
@github-actions github-actions bot added the apidiff Indicates Go API changes relevant to library consumers (CLI compatibility may be unaffected) label Jan 15, 2026
@aqua-bot aqua-bot requested a review from a team January 15, 2026 13:43
… values

Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
@nikpivkin nikpivkin force-pushed the refactor/iac-values branch from 675efde to 0dc3371 Compare January 15, 2026 18:26
@nikpivkin nikpivkin added this pull request to the merge queue Jan 16, 2026
Merged via the queue into aquasecurity:main with commit 5602951 Jan 16, 2026
14 checks passed
@nikpivkin nikpivkin deleted the refactor/iac-values branch January 16, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apidiff Indicates Go API changes relevant to library consumers (CLI compatibility may be unaffected)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants