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

Chore/cleanup linting #43

Merged
merged 12 commits into from
Feb 5, 2024
Merged

Chore/cleanup linting #43

merged 12 commits into from
Feb 5, 2024

Conversation

puffitos
Copy link
Collaborator

@puffitos puffitos commented Feb 2, 2024

Motivation

General cleanup of repository, adding linting for the go code and automatic testing (no automatic E2E) before committing, to assure better code quality and non-broken commits.

This is in preparation for the new feature, to allow the COSIGN_REPOSITORY variable to be used by user workloads.

Changes

  • E2E: go 1.21
  • chore: bumped to latest go dependencies
  • feat: added golangci and pre-commit
  • docs: corrections in README and Makefile
  • tests: E2E tests timeout properly now
  • tests: added failing E2E case when the signature is in another repository and not in the same as the image
  • tests: added named returned values for helper method
  • sec: min TLS versions and timeout for headers set
  • chore: moved same typed variables together in functions
  • chore: renamed variables to avoid shadowing packages
  • chore: replace len(stringVar) == 0 with stringVar == ""
  • perf: replaced some looping over variables with indexing to save some RAM ( 💚 )
  • refactor: newKeychainForPod to reduce complexity of Serve function
  • chore: replaced int values for codes with the http package's constants

Added a new test case for the COSIGN_REPOSITORY variable
and made the e2e tests more robust by properly handling timeouts,
which weren't working half the time.

Signed-off-by: Bruno Bressi <[email protected]>
- Reduced complexity of Server
- Reduce memory footprint for checking loops
- Other minor renamings & fixes

Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
@eumel8 eumel8 merged commit 68485e0 into main Feb 5, 2024
13 checks passed
@eumel8 eumel8 deleted the chore/cleanup-linting branch February 5, 2024 18:36
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