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

Enable linter analysis cache build phase and run the build tagger before linting #649

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented Nov 5, 2024

Description of your changes

Fixes

Linting is now done in two phases to decrease the memory footprint of linting:

  1. An initial analysis cache build phase
  2. And the actual linting phase

Please refer to crossplane-contrib/provider-upjet-aws#1217 for further details on the implemented techniques. Please note that I have not attempted to fine tune the parameters in this PR, they are probably too aggressive for the provider-gcp repo. If linting becomes to long to execute, we can revisit these parameters.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Validated locally by running GOLANGCI_LINT_CACHE=/tmp/golangci-lint SKIP_LINTER_ANALYSIS=false RUN_BUILDTAGGER=true make lint. Also introduced linter errors and observed that the linter can successfully detect them.

…ore linting

- Linting is now done in two phases: an initial analysis cache build phase,
  and then the actual linting phase, to decrease the memory footprint of
  linting.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
@ulucinar
Copy link
Collaborator Author

ulucinar commented Nov 5, 2024

For the initial run of the linter in the CI pipelines, the first phase has consumed ~3.5GB of memory and the second phase has consumed ~7GB of memory. Recording as a reference here...

@ulucinar
Copy link
Collaborator Author

ulucinar commented Nov 5, 2024

/test-examples="examples/cloudplatform/v1beta1/serviceaccount.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Thank you @ulucinar, LGTM 🙌

@ulucinar ulucinar merged commit c0da23f into crossplane-contrib:main Nov 5, 2024
9 checks passed
@ulucinar ulucinar deleted the fix-linter branch November 5, 2024 09:51
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.

2 participants