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

Add --disable-checks flag to deploy #1429

Merged
merged 3 commits into from
Sep 9, 2022
Merged

Add --disable-checks flag to deploy #1429

merged 3 commits into from
Sep 9, 2022

Conversation

iameskild
Copy link
Member

Fixes | Closes | Resolves #

Please remove anything marked as optional that you don't need to fill in.
Choose one of the keywords preceding to refer to the issue this PR solves, followed by the issue number (e.g Fixes # 666).
If there is no issue, remove the line. Remove this note after reading.

Changes introduced in this PR:

-Under special circumstances, users might need to disable the checks that take place at the end of each stage. This new flags allows for that possibility.

Types of changes

What types of changes does your PR introduce?

Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests?

  • Yes
  • No

Documentation

Does your contribution include breaking changes or deprecations?
If so have you updated the documentation?

  • Yes, docstrings
  • Yes, main documentation
  • Yes, deprecation notices

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered and more.

directory = "stages/08-qhub-tf-extensions"

stage_outputs[directory] = terraform.deploy(
directory=directory,
input_vars=input_vars.stage_08_qhub_tf_extensions(stage_outputs, config),
)

if check:
Copy link
Member

@costrouc costrouc Sep 8, 2022

Choose a reason for hiding this comment

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

I often find double negatives harder to reason about but don't have a strong opinion that it must be this way. What do you think?

provision_02_infrastructure(stage_outputs, config, disable_checks)

def provision_02_infrastructure(stage_outputs, config, disable_checks=False):
      if not disable_checks:
          ...

vs.

provision_02_infrastructure(stage_outputs, config, (not disable_checks))

def provision_02_infrastructure(stage_outputs, config, check=True):
      if check:
          ...

Copy link
Member Author

@iameskild iameskild Sep 9, 2022

Choose a reason for hiding this comment

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

Yeah I understand where you're coming from. In this case, I feel like it reads in a fairly comprehensible way but I'm open to other options as well. I do find this pattern a little confusing myself provision_02_infrastructure(stage_outputs, config, (not disable_checks)).

Perhaps we could do something like this instead:

    if disable_checks:
        return 
    checks.stage_02_infrastructure(stage_outputs, config

@costrouc costrouc merged commit c5dc6dd into main Sep 9, 2022
@costrouc costrouc deleted the add_disable_checks_flag branch September 9, 2022 02:35
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.

2 participants