Skip to content

Conversation

@iamleot
Copy link
Contributor

@iamleot iamleot commented Jun 7, 2025

In conftest v0.61.0 the behavior of --update changed in order to fetch the policy URLs and stored them in a temporary directory.

It broke the previous behavior that updated current policy directory and instead aggregated the current policy (under policy) with the one(s) used in --update.

It also broke the behavior of a project that had no existing policy.

This reverts commit ed0ff0a.

Fixes #1136.


I have also added corresponding acceptance tests in order to exercise such behavior.


Please note that #1106 maybe needs to be reopened and/or inspected again. I have mostly focused on resurrecting the old behavior because the current one broke all my conftest usecases and maybe it will be the same for other folks.


If this change is okay I think it would be nice to also tag a 0.61.10.61.2 release in order to avoid that regression.


Thanks a lot!

Copy link
Member

@jalseth jalseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the regression, and thanks for adding a test to cover this!

Copy link
Member

@jalseth jalseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the acceptance tests are failing, please fix and I will merge.

iamleot added 2 commits June 8, 2025 00:19
In conftest v0.61.0 the behavior of --update changed in order to fetch
the policy URLs and stored them in a temporary directory.

It broke the previous behavior that updated current policy directory
and instead aggregated the current policy (under `policy`) with the
one(s) used in `--update`.

It also broke the behavior of a project that had no existing `policy`.

This reverts commit ed0ff0a.

Fixes #1136.

Signed-off-by: Leonardo Taccari <[email protected]>
Add an acceptance test in order to ensure that:

- conftest test --update create/populate policy directory
- conftest test --update update the policy directory with the now
  policies that are fetched remotely

Fixes #1136.

Signed-off-by: Leonardo Taccari <[email protected]>
@iamleot
Copy link
Contributor Author

iamleot commented Jun 7, 2025

Whoops, sorry. I have tested directly only that bats.test and I set CONFTEST manually to the absolute path, shame on me!

CONFTEST is actually set to ../../conftest and the cd "${TEMP_DIR}" messed up that.

I have just adjusted it in order to always refers to absolute paths and avoiding the cd completely.

(I have retested locally to also verify that and I hope this time should be fine!)

Thanks James!

@iamleot
Copy link
Contributor Author

iamleot commented Jun 7, 2025

PS: I've also rebased to latest master and pushed with the force by fixing up the last commit with the test.

@jalseth jalseth merged commit e156f0d into open-policy-agent:master Jun 10, 2025
8 checks passed
@iamleot
Copy link
Contributor Author

iamleot commented Jun 10, 2025

Thank you very much James!

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.

Semantic of conftest test --update changed since 0.61.0 (commit ed0ff0a76feacc1707b0c3b23e533a464c988cd0)

2 participants