Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[W.I.P] Fix: Waived control executes describe block #6807

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vasu1105
Copy link
Contributor

Description

Evaluates the describe block only if the waived control run is set to true or the waiver is expired. This ensures the describe block of the waived control should not be executed.

Waived control should not be executed and skipped without execution of describe block.

This change helps in eliminating the efforts to use options --filter-waived-controls and --retain-waiver-data.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.

@Vasu1105 Vasu1105 requested a review from a team as a code owner October 19, 2023 00:28
@netlify
Copy link

netlify bot commented Oct 19, 2023

Deploy Preview for chef-inspec canceled.

Name Link
🔨 Latest commit ea41ebc
🔍 Latest deploy log https://app.netlify.com/sites/chef-inspec/deploys/6581866756f572000874500c

instance_eval(&block)

# By applying waivers *after* the instance eval, we assure that
# waivers have higher precedence than only_if.
Copy link
Contributor Author

@Vasu1105 Vasu1105 Oct 19, 2023

Choose a reason for hiding this comment

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

Not seen any impact on the precedence even if _apply_waivers is called before instance_eval. Calling _apply_waivers here is required to get all the waiver data so that only in the valid condition we will evaluate the describe block, for example, if the run is set to true and if waiver is expired.

…e or the waiver is expired. This ensures the describe block of the waived control should not be executed.

Signed-off-by: Vasu1105 <[email protected]>
Signed-off-by: Vasu1105 <[email protected]>
@Vasu1105 Vasu1105 force-pushed the vj/fix-waivers-to-not-execute-describe-block-for-waived-controls branch from 7899adc to ea41ebc Compare December 19, 2023 12:02
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.

None yet

1 participant