Skip to content

Update go-getter to the latest version#1441

Merged
aknysh merged 21 commits intomainfrom
update-go-getter
Sep 3, 2025
Merged

Update go-getter to the latest version#1441
aknysh merged 21 commits intomainfrom
update-go-getter

Conversation

@aknysh
Copy link
Member

@aknysh aknysh commented Sep 2, 2025

what

  • Update go-getter to the latest version
  • Make DisableSymlinks configurable on the git client

why

  • The dependency github.com/hashicorp/go-getter:v1.7.8 was vulnerable:
    "CVE-2025-8959", Score: 7.5
    HashiCorp's go-getter library subdirectory download feature is vulnerable to symlink attacks leading to unauthorized
    read access beyond the designated directory boundaries. This vulnerability, identified as "CVE-2025-8959",
    is fixed in go-getter 1.7.9.
    Read More: https://www.mend.io/vulnerability-database/CVE-2025-8959

@aknysh aknysh requested a review from osterman September 2, 2025 20:05
@aknysh aknysh self-assigned this Sep 2, 2025
@aknysh aknysh requested a review from a team as a code owner September 2, 2025 20:05
@aknysh aknysh added the minor New features that do not break anything label Sep 2, 2025
@github-actions github-actions bot added the size/l Large size PR label Sep 2, 2025
@mergify
Copy link

mergify bot commented Sep 2, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Sep 2, 2025
Copy link
Contributor

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

golangci-lint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 81.75896% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.98%. Comparing base (5e2f1c3) to head (b612d26).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/downloader/get_git.go 81.39% 45 Missing and 11 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1441      +/-   ##
==========================================
+ Coverage   55.59%   55.98%   +0.38%     
==========================================
  Files         273      274       +1     
  Lines       28626    28928     +302     
==========================================
+ Hits        15916    16194     +278     
- Misses      10927    10940      +13     
- Partials     1783     1794      +11     
Flag Coverage Δ
unittests 55.98% <81.75%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@github-actions github-actions bot added size/xl Extra large size PR and removed size/l Large size PR labels Sep 2, 2025
@aknysh aknysh changed the title Update go-getter to th latest version Update go-getter to the latest version Sep 2, 2025
@mergify
Copy link

mergify bot commented Sep 2, 2025

Warning

This PR exceeds the recommended limit of 1,000 lines.

Large PRs are difficult to review and may be rejected due to their size.

Please verify that this PR does not address multiple issues.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

* test: increase test coverage for go-getter downloader to 77.7%

- Add comprehensive tests for GetCustom() method covering various scenarios (89.1% coverage)
- Add tests for git operations: clone (90.9%), update (86.5%), checkout (100%), fetchSubmodules (100%)
- Add tests for findRemoteDefaultBranch() method (100% coverage)
- Add tests for CustomGitGetter.Get() method (100% coverage)
- Define static errors in errors/errors.go to comply with golangci-lint err113
- Format code with gofumpt
- Overall package coverage increased from 46.1% to 77.7%

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* updates

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>
osterman
osterman previously approved these changes Sep 3, 2025
- Replace deprecated io/ioutil with os.CreateTemp
- Add constants for magic numbers (base10, portBitSize, sshKeyFileMode)
- Add constants for repeated strings (gitCommand, originRemote, gitArgSeparator)
- Create gitOperationParams struct to reduce function arguments
- Fix invalid URL construction in tests
- Remove unused return values from test helper functions
- Fix potential index out of bounds issue
- Add #nosec comments for validated subprocess commands
- Apply gofumpt formatting

Reduces linting issues from 20 to 6 (remaining are complexity warnings)
@aknysh aknysh requested a review from osterman September 3, 2025 05:09
@aknysh aknysh merged commit 4c89983 into main Sep 3, 2025
52 checks passed
@aknysh aknysh deleted the update-go-getter branch September 3, 2025 05:10
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Sep 3, 2025
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

These changes were released in v1.189.0.

osterman added a commit that referenced this pull request Sep 5, 2025
- Resolve conflict in .gitignore by combining both test artifact entries
- Includes latest main branch changes:
  - Update go-getter to latest version (#1441)
  - Make inline atmos config override config from imports (#1447)
  - Replace t.Skip with t.Skipf throughout codebase (#1449)
- Maintains all gotcha-related changes from feature branch
osterman added a commit that referenced this pull request Sep 23, 2025
* updates

* updates

* updates

* updates

* updates

* updates

* [autofix.ci] apply automated fixes

* updates

* [autofix.ci] apply automated fixes

* updates

* updates

* updates

* updates

* test: increase test coverage for go-getter downloader to 77.7% (#1443)

* test: increase test coverage for go-getter downloader to 77.7%

- Add comprehensive tests for GetCustom() method covering various scenarios (89.1% coverage)
- Add tests for git operations: clone (90.9%), update (86.5%), checkout (100%), fetchSubmodules (100%)
- Add tests for findRemoteDefaultBranch() method (100% coverage)
- Add tests for CustomGitGetter.Get() method (100% coverage)
- Define static errors in errors/errors.go to comply with golangci-lint err113
- Format code with gofumpt
- Overall package coverage increased from 46.1% to 77.7%

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* updates

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>

* fix: resolve golangci-lint issues in pkg/downloader (#1445)

- Replace deprecated io/ioutil with os.CreateTemp
- Add constants for magic numbers (base10, portBitSize, sshKeyFileMode)
- Add constants for repeated strings (gitCommand, originRemote, gitArgSeparator)
- Create gitOperationParams struct to reduce function arguments
- Fix invalid URL construction in tests
- Remove unused return values from test helper functions
- Fix potential index out of bounds issue
- Add #nosec comments for validated subprocess commands
- Apply gofumpt formatting

Reduces linting issues from 20 to 6 (remaining are complexity warnings)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything size/xl Extra large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants