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

Linting baseline and initial Circle/CI integration #81

Closed
wants to merge 39 commits into from
Closed

Conversation

jadudm
Copy link
Contributor

@jadudm jadudm commented Jan 11, 2025

We prefer smaller PRs that merge more often.

Haiku-length summary

Amidst drifting snow
So much lint like water flows
Once, and future, fluff

Additional details

image

linting

This introduces golangci-lint, and integrates it into the stack. This can (currently) be triggered locally either via make lint (if the tools are installed locally), or make containerlint to run in a containerized environment.

Hundreds of linting errors were addressed. Some were flagged as nolint on a per-file basis (e.g. linting involving naming of test packages, or some documentation linting), some were flagged per-line, and some were put in the ignore list.

The linting that was flagged/ignored will need to be addressed as debt. This provides us an initial baseline where the code passes a rigorous set of linting, and makes clear where we want to do some fixes (the ignores/nolint lines).

Circle/CI

We cannot use Github Actions. We can use Circle/CI. This introduces a basic C/CI config. It allows us to

  1. Lint, and
  2. Build

The configuration successfully lints in the cloud, and only goes on to build the application if the linting passes.

related tickets

This work is in partial fulfillment of:

PR Checklist: Submitter

  • Link to an issue if possible. If there’s no issue, describe what your branch does. Even if there is an issue, a brief description in the PR is still useful.
  • List any special steps reviewers have to follow to test the PR. For example, adding a local environment variable, creating a local test file, etc.
  • For extra credit, submit a screen recording like this one.
  • Make sure you’ve merged main into your branch shortly before creating the PR. (You should also be merging main into your branch regularly during development.)
  • Make sure that whatever feature you’re adding has tests that cover the feature. This includes test coverage to make sure that the previous workflow still works, if applicable.
  • Make sure the E2E tests pass.
  • Do manual testing locally.
    • If that’s not applicable for some reason, check this box.
  • Once a PR is merged, keep an eye on it until it’s deployed to dev, and do enough testing on dev to verify that it deployed successfully, the feature works as expected, and the happy path for the broad feature area still works.

PR Checklist: Reviewer

  • Pull the branch to your local environment and run make macup ; make e2e" (FIXME)
  • Manually test out the changes locally
    • Check this box if not applicable in this case.
  • Check that the PR has appropriate tests.

The larger the PR, the stricter we should be about these points.

jadudm added 30 commits January 9, 2025 09:24
These are not nice in CircleCi/YAML.
Should be faster
Although this would be nice as a separate commit, I'm working to get the
automated builds going. It ended up in this branch.

This added `if err != nil` in many places.
This moves linting into the container in the makefile.

Also, more code with linting issues that I forgot to commit.

Want to see this work in Circle/CI.
Should we use *all* of the lints?

Either way, lots of formatting.
This gets us to litner zero.
I lied. Forgot a directory.
internal/filtering/nasa.go Dismissed Show dismissed Hide dismissed
@jadudm jadudm requested a review from a team January 11, 2025 16:52
Feel like there must be a better way.

Even with the fixes, the linter is angry.

This does address CodeQL, however.
Dependabot is angry.
Copy link
Contributor

@IsabelLaurenceau IsabelLaurenceau left a comment

Choose a reason for hiding this comment

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

After docker desktop update containers run correctly, and I am able to run make containerlint as expected

@jadudm jadudm mentioned this pull request Jan 14, 2025
13 tasks
@jadudm jadudm dismissed IsabelLaurenceau’s stale review January 14, 2025 14:09

The merge-base changed after approval.

@jadudm
Copy link
Contributor Author

jadudm commented Jan 14, 2025

Superceded by #88. Closing this.

@jadudm jadudm closed this Jan 14, 2025
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