Skip to content

Conversation

@tekenstam
Copy link
Member

@tekenstam tekenstam commented Apr 14, 2025

Summary

This PR makes two key improvements to the instance-manager project:

  1. Restructures GitHub Actions workflows for better organization and efficiency
  2. Fixes various code quality issues identified by golangci-lint

GitHub Actions Improvements

Workflow Separation

  • ✅ Extracted CodeQL analysis into a dedicated workflow file
  • ✅ Extracted Golangci-lint checks into a dedicated workflow file
  • ✅ Removed redundant steps from existing workflows to avoid duplication

Docker Build/Push Improvements

  • ✅ Added proper semantic version tagging with docker/metadata-action
  • ✅ Enhanced multi-architecture build support
  • ✅ Improved conditional image pushing (skip on PRs)
  • ✅ Added proper GitHub permissions for workflow operations

Code Quality Fixes

  • ✅ Fixed embedded field issues:
    • Removed direct .ObjectMeta references for better structure
    • Used proper pattern for DeletionTimestamp access
  • ✅ Improved code structure in AWS worker:
    • Lifted counter condition into loop condition
    • Used tagged switch instead of if-else chains
  • ✅ Fixed error return order in functions to follow Go conventions
  • ✅ Corrected error message capitalization to follow Go best practices
  • ✅ Updated corresponding tests to match corrected error formats

Testing

All unit tests are passing with the changes.

Compatibility

These changes maintain full backward compatibility with existing functionality.

@tekenstam tekenstam requested review from a team as code owners April 14, 2025 00:21
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@tekenstam tekenstam requested review from a team as code owners April 14, 2025 00:44
@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 60.52632% with 15 lines in your changes missing coverage. Please review.

Project coverage is 46.13%. Comparing base (bce2d0c) to head (62270ac).

Files with missing lines Patch % Lines
controllers/instancegroup_controller.go 0.00% 6 Missing ⚠️
controllers/providers/aws/aws.go 0.00% 5 Missing ⚠️
controllers/providers/aws/eks.go 0.00% 3 Missing ⚠️
controllers/provisioners/eks/helpers.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #470      +/-   ##
==========================================
+ Coverage   46.11%   46.13%   +0.01%     
==========================================
  Files          40       40              
  Lines        7007     7004       -3     
==========================================
  Hits         3231     3231              
+ Misses       3620     3617       -3     
  Partials      156      156              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Todd Ekenstam <[email protected]>
@tekenstam tekenstam changed the title Improve GitHub Action Workflows Improve GitHub Action Workflows and Fix Linting Issues Apr 14, 2025
@tekenstam tekenstam merged commit 6ceb5ab into master Apr 14, 2025
7 checks passed
@tekenstam tekenstam deleted the fix-push-workflow branch April 14, 2025 01:21
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.

3 participants