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(npm): include credentials without host type for lock file generation #34267

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

languitar
Copy link

@languitar languitar commented Feb 17, 2025

Changes

So far, the post-update task for generating the NPM lock file did not pick up credentials from hostRules that lacked a hostType. This was inconsistent to the way renovate had previously determined updatable dependencies. The code path there also included ruleRules without a hostType defined. As a result, PRs would potentially fail because the lock file generation did not have the same set of credentials available as the trigger for creating a PR at all.

Now, lock file generation also picks up credentials without a defined hostType.

Context

Related discussion: #34203

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

.getAll()
.filter((rule) => rule.hostType === null || rule.hostType === undefined);
const effectiveHostRules = npmHostRules.concat(noTypeHostRules);
logger.debug(`Found ${effectiveHostRules.length} npm host rule(s)`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you log how many were found with hostType=npm and then how many were found with empty hostType?

Copy link
Author

Choose a reason for hiding this comment

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

This should be resolved already?

@languitar languitar force-pushed the bugfix/npm-post-update-include-rules-without-host-type branch 2 times, most recently from f8a262a to 027c653 Compare February 18, 2025 15:30
rarkins
rarkins previously approved these changes Feb 18, 2025
@rarkins rarkins requested review from viceice and secustor February 18, 2025 15:54
token: 'sometoken',
});
const res = processHostRules();
expect(res).toMatchInlineSnapshot(
Copy link
Member

Choose a reason for hiding this comment

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

no snapshot, use toEqual

Copy link
Author

Choose a reason for hiding this comment

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

Sorry for the delay. Changed now.

So far, the post-update task for generating the NPM lock file did not
pick up credentials from `hostRules`` that lacked a `hostType`. This was
inconsistent to the way renovate had previously determined updatable
dependencies. The code path there also included `ruleRules` without a
`hostType` defined. As a result, PRs would potentially fail because the
lock file generation did not have the same set of credentials available
as the trigger for creating a PR at all.

Now, lock file generation also picks up credentials without a defined
`hostType`.

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
@languitar languitar force-pushed the bugfix/npm-post-update-include-rules-without-host-type branch from 6e1b0bd to e18d1b0 Compare March 10, 2025 15:26
@languitar languitar requested review from viceice and rarkins March 10, 2025 15:26
@viceice
Copy link
Member

viceice commented Mar 10, 2025

please avoid force push

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