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

GitHub Action for PR Check should only validate files that have changed. #86

Closed
CalvinRodo opened this issue Nov 25, 2021 · 4 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@CalvinRodo
Copy link

Instead of validating all the files in the Bicep files in the repo it should only validate bicep scripts that have been modified since the last PR

This scan takes 6 minutes to run in a PR that has zero changes to bicep scripts, although this PR does add a variable that was missing. However based on the fact that my PR missing the required variable passed this check I'm assuming the template validation doesn't check for variables so I'm guessing it doesn't need to run unless files being validated are changed.

@SenthuranSivananthan
Copy link
Contributor

We validate all Bicep files because it is the only way to know if any changes have cascading failures in the references.

Can you share your example where the PR check didn't work?

@CalvinRodo
Copy link
Author

To Replicate what happened just remove the var-logging-logAnalyticsRetentionInDays variable from the configuration variables.

I grabbed files from upstream and merged that in.

The PR that I merged without the variable is here:
cds-snc#3

@SenthuranSivananthan
Copy link
Contributor

I understand the scenario now. We don't run the deployments during the PR check to validate if the inputs are validate. This would increase the PR check time to multiple hours given some scenarios like SQL Managed Instances can take ~ 3 hours to provision.

In this case, the variable from the config file and not related to the Bicep templates themselves.

We are looking to move the configuration from YAML to JSON and add json schema validation. This validation would catch these missing parameters. This work is already complete for the archetypes like Generic Subscriptions, Machine Learning & Healthcare and it's checked in the PR validation step.

Our next focus area would be Logging & Networking but I don't have an ETA yet.

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants