Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ci: enable CodeQL code scanning #5279

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

Merged
merged 19 commits into from
Dec 22, 2022
Merged

ci: enable CodeQL code scanning #5279

merged 19 commits into from
Dec 22, 2022

Conversation

matifali
Copy link
Member

@matifali matifali commented Dec 3, 2022

No description provided.

@matifali
Copy link
Member Author

matifali commented Dec 6, 2022

Hi @kylecarbs. What do you think about running this security analysis?

@github-actions
Copy link

This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Dec 19, 2022
@matifali
Copy link
Member Author

@ghuntley. You may close this if not planned.

@mafredri mafredri changed the title chore: enable GraphQL code scanning chore: enable CodeQL code scanning Dec 19, 2022
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Personally I think this could be a nice addition, thanks for the PR! I'd like to know what @kylecarbs and @ghuntley think though (maybe @deansheather too?). And if we do want to merge, we should fix/silence the current errors first.

(PS. To fix the test/js failure, rebase/merge on top of master.)

strategy:
fail-fast: false
matrix:
language: [ 'go', 'javascript' ]
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@matifali matifali Dec 20, 2022

Choose a reason for hiding this comment

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

Yes we may limit this scanning to only ./site. You are welcome to propose this change.

@mafredri mafredri removed the stale This issue is like stale bread. label Dec 19, 2022
@matifali matifali requested review from deansheather and mafredri and removed request for ghuntley, kylecarbs, deansheather and mafredri December 20, 2022 04:41
@deansheather
Copy link
Member

I think this is good to merge but I would like approval from @ElliotG first. I will ask them in slack

@deansheather
Copy link
Member

Elliot is unavailable at the moment so once Mathias approves we can merge.

Co-authored-by: Mathias Fredriksson <[email protected]>
@mafredri
Copy link
Member

mafredri commented Dec 20, 2022

With bcde5f3 it now runs faster (still pretty slow @ 7+ minutes though). It's a bit of an ugly hack but it works.

The go mod download seems useless though, the perform analysis step does it's own download/module install even though we do the download beforehand.

https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302

@mafredri
Copy link
Member

Actually, we may want to put back the manual installation of specific Go version, just spotted this output:

2022/12/20 11:10:43 Autobuilder was built with go1.19.3, environment has go1.18.9
[52](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:53)
  2022/12/20 11:10:43 LGTM_SRC is /home/runner/work/coder/coder
[53](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:54)
  2022/12/20 11:10:43 Found go.mod, enabling go modules
[54](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:55)
  go: go.mod file indicates go 1.19, but maximum version supported by tidy is 1.18
[55](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:56)

Since we use go 1.19, I'm guessing it'd be good for the environment to be go 1.19 as well.

Updated as per @mafredri suggestion.
@matifali
Copy link
Member Author

Actually, we may want to put back the manual installation of specific Go version, just spotted this output:

2022/12/20 11:10:43 Autobuilder was built with go1.19.3, environment has go1.18.9
[52](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:53)
  2022/12/20 11:10:43 LGTM_SRC is /home/runner/work/coder/coder
[53](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:54)
  2022/12/20 11:10:43 Found go.mod, enabling go modules
[54](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:55)
  go: go.mod file indicates go 1.19, but maximum version supported by tidy is 1.18
[55](https://github.com/coder/coder/actions/runs/3739932860/jobs/6347716302#step:5:56)

Since we use go 1.19, I'm guessing it'd be good for the environment to be go 1.19 as well.

Removed go mod download and added the go 1.19 installation back.

@mafredri
Copy link
Member

mafredri commented Dec 21, 2022

Removed go mod download and added the go 1.19 installation back.

👍

I noticed the rm Makefile also got removed. Without it the analysis step (for Go) downloads node modules and builds the site package (and other make commands as well). It adds unneeded execution time. I would love another way to disable it though but found nothing in the docs.

@matifali
Copy link
Member Author

matifali commented Dec 22, 2022

Removed go mod download and added the go 1.19 installation back.

👍

I noticed the rm Makefile also got removed. Without it the analysis step (for Go) downloads node modules and builds the site package (and other make commands as well). It adds unneeded execution time. I would love another way to disable it though but found nothing in the docs.

Added that back @mafredri But still taking +7 minutes.

@matifali matifali requested a review from mafredri December 22, 2022 12:57
@mafredri
Copy link
Member

mafredri commented Dec 22, 2022

Added that back @mafredri But still taking +7 minutes.

Thanks. Yeah it's too bad. I'm not sure if we can beat the 7min by much but I tried adding go mod caching in hopes that it'd save some time, let's see.

EDIT: Nice, down to a bit over 5min.

@mafredri mafredri changed the title chore: enable CodeQL code scanning ci: enable CodeQL code scanning Dec 22, 2022
@mafredri mafredri merged commit 341c432 into coder:main Dec 22, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2022
@mafredri
Copy link
Member

Thought it’d be nice to get this in so I hit merge. Thanks for your contribution @matifali! (We can always iterate on this further if something needs tweaking.)

@matifali matifali deleted the GraphQL-code-scanning branch December 23, 2022 03:45
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.

4 participants