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

fix(bundler): authentication using only env vars #33339

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

lbarros-asml
Copy link

@lbarros-asml lbarros-asml commented Dec 30, 2024

Changes

Change the bundle authentication to use ENV vars for hostnames with hyphen. Discussion #33205

I might need help with the unit tests because I'm not a js/typescript developer.

Context

#33205

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@lbarros-asml lbarros-asml changed the title Bundle authentication using ENV #33205 fix(bundler) Authentication using ENV #33205 Dec 30, 2024
@lbarros-asml lbarros-asml changed the title fix(bundler) Authentication using ENV #33205 fix(bundler): authentication using ENV #33205 Dec 30, 2024
@rarkins rarkins changed the title fix(bundler): authentication using ENV #33205 fix(bundler): authentication using only env Dec 31, 2024
Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Needs tests/test updating too

lib/modules/manager/bundler/artifacts.ts Show resolved Hide resolved
@lbarros-asml
Copy link
Author

lbarros-asml commented Dec 31, 2024

Needs tests/test updating too

Tests updated. I've just removed the tests checking if the "bundler config" auth commands were running and changed the "gems.private.com" host to "gems-private.com" so the hyphen replacement is working properly when creating the environment variable.

@CLAassistant
Copy link

CLAassistant commented Dec 31, 2024

CLA assistant check
All committers have signed the CLA.

@lbarros-asml lbarros-asml requested a review from rarkins December 31, 2024 12:39
'-e GEM_HOME ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool ruby 1.2.0' +
' && ' +
'install-tool bundler 1.3.0' +
'install-tool bundler 2.3.5' +
Copy link
Collaborator

Choose a reason for hiding this comment

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

What caused this line to change in the test?

Copy link
Author

@lbarros-asml lbarros-asml Dec 31, 2024

Choose a reason for hiding this comment

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

This is GitHub diff pranking us. I actually didn't remove those lines:
https://github.com/renovatebot/renovate/pull/33339/files#diff-5421e221c5a44026d537b2f1168b1ce07db041069cba49bf2ba6462848e6c5cfL438-L489

So, because the line you mentioned is part of the block that I actually removed, It mixed things up and displayed a bogus visualization.

Happy new year! 🎉

@@ -32,14 +30,16 @@ import {
const hostConfigVariablePrefix = 'BUNDLE_';

function buildBundleHostVariable(hostRule: HostRule): Record<string, string> {
if (!hostRule.resolvedHost || hostRule.resolvedHost.includes('-')) {
if (!hostRule.resolvedHost) {
return {};
Copy link
Author

Choose a reason for hiding this comment

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

@rarkins , this is the line failing the test coverage. I wonder if checking the "hostRule.resolvedHost" is even necessary. If not, I can remove the if statement. Otherwise, I'd appreciate any help creating a proper test.

@lbarros-asml lbarros-asml requested a review from rarkins December 31, 2024 20:58
@lbarros-asml lbarros-asml changed the title fix(bundler): authentication using only env fix(bundler): authentication using only env vars Jan 2, 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.

4 participants