Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add GHA dependency check #5264

Merged
merged 3 commits into from
Jul 8, 2022
Merged

Add GHA dependency check #5264

merged 3 commits into from
Jul 8, 2022

Conversation

cds-amal
Copy link
Member

@cds-amal cds-amal commented Jul 6, 2022

This PR builds on #5230 to address #5236 by adding a GitHub action to CI. I didn't create a separate job for the dependency check because it would require the expensive yarn bootstrap command and I don't want CI to take longer. Instead, I inserted the dependency-check into the matrix strategy build job to take advantage of the matrix's short-circuiting behavior. If one matrix job fails, it cancels all others. I also updated the Slack-app config and made the matrix-build job a dependency of yarncheck. yarncheck resolves in ~2.5 minutes and then the matrix job runs, followed by Slack notification.

If this is approved, I will rebase to remove all simulated errors

@cds-amal cds-amal marked this pull request as draft July 6, 2022 13:33
@cds-amal cds-amal force-pushed the gha-dep-check branch 3 times, most recently from 34c5e5a to 68e6f1e Compare July 7, 2022 01:19
@cds-amal cds-amal force-pushed the gha-dep-check branch 3 times, most recently from 4092aa7 to a04c46d Compare July 7, 2022 14:41
@cds-amal cds-amal marked this pull request as ready for review July 7, 2022 15:59
Copy link
Contributor

@haltman-at haltman-at left a comment

Choose a reason for hiding this comment

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

Hm, would it make more sense to just put the test in the yarncheck job? My understanding was that a failure of yarncheck would also cancel the others... is that not the case? That's what I've always observed...

- run: yarn bootstrap

- run: yarn depcheck || (echo 'Please add missing dependencies to appropriate package'; false)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're probably better off without the explicit custom error message here; I think the existing error is clear enough and the method for including it is kind of hacky. I only put an explicit custom error message on yarncheck because otherwise it's just not clear at all with that one.

(If yarn --frozen-lockfile worked like it was supposed to, and I didn't need the custom test, then that would probably be clear and I could omit the custom error... but it doesn't, so yeah.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I'll remove that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Simulated an error and it looks ok.

@cds-amal
Copy link
Member Author

cds-amal commented Jul 8, 2022

Hm, would it make more sense to just put the test in the yarncheck job? My understanding was that a failure of yarncheck would also cancel the others... is that not the case? That's what I've always observed...

I would prefer doing these build/lint type checks in one job, but dependency-check needs yarn bootstrap to build out the entry points; I wanted to avoid adding another 12-13 minutes to the yarncheck job. I'm also unsure why the cancel behavior changed, as I remember it working as you did, but testing showed otherwise.

@haltman-at
Copy link
Contributor

Makes sense!

@cds-amal
Copy link
Member Author

cds-amal commented Jul 8, 2022

Will rebase to remove the simulated errors

@cds-amal cds-amal requested a review from haltman-at July 8, 2022 16:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants