GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Filter registry credentials by language by marcogario · Pull Request #2680 · github/codeql-action

Conversation

@marcogario

@marcogario marcogario commented Jan 10, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Introduce the language parameter for the start-proxy action so we know which credentials we should use.

By specifying the language with disambiguating cases where the same registry has distinct credentials. For example, in Artifactory it is possible to use a token that is scoped to the nuget feed, while the maven repository uses the username/password combination.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marcogario marcogario self-assigned this Jan 10, 2025
github-advanced-security[bot]
github-advanced-security AI found potential problems Jan 10, 2025
View reviewed changes
Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@marcogario
marcogario force-pushed the marcogario/filter_registries branch 2 times, most recently from 4263e13 to 0e7e3db Compare January 13, 2025 10:44
github-advanced-security[bot]
github-advanced-security AI found potential problems Jan 13, 2025
View reviewed changes
Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@marcogario
Filter registry credentials by language
e02d65a
@marcogario
marcogario force-pushed the marcogario/filter_registries branch from 0e7e3db to e02d65a Compare January 13, 2025 10:52
@marcogario
Support both namings for java
de0f9cf
@marcogario
marcogario force-pushed the marcogario/filter_registries branch from d9e8b07 to de0f9cf Compare January 13, 2025 16:15
@marcogario
marcogario marked this pull request as ready for review January 13, 2025 16:17
@marcogario
marcogario requested a review from a team as a code owner January 13, 2025 16:17
@marcogario
marcogario requested review from aibaars and removed request for a team January 13, 2025 16:20
aeisenberg
aeisenberg reviewed Jan 13, 2025
View reviewed changes
Comment thread src/start-proxy-action.ts Outdated
const KEY_EXPIRY_YEARS = 2;

const LANGUAGE_TO_REGISTRY_TYPE = {
"java-kotlin": "maven_repository",

@aeisenberg aeisenberg Jan 13, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Should you add kotlin as a standalone language?

Also there is languages.ts, which is where we've traditionally added language-specific logic. I think I'd prefer to move this declaration to that file.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marcogario reacted with heart emoji
All reactions
  • ❤️ 1 reaction

@marcogario marcogario Jan 14, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I've pushed a commit where this logic better integrates with languages.ts, by reusing the Language type defined there.

I am 50/50 on whether we should move this map there. The main reason against doing so is that this information is really only useful for the proxy action and even the names of the registry types are fairly arbitrary and dependent on the specifics of the proxy binary. WDYT?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aeisenberg aeisenberg Jan 14, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm fine if the logic doesn't go into language.ts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marcogario
marcogario force-pushed the marcogario/filter_registries branch from f33e08c to 529f92f Compare January 14, 2025 14:21
github-advanced-security[bot]
github-advanced-security AI found potential problems Jan 14, 2025
View reviewed changes
Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@marcogario
Use Language type
31d11b1
@marcogario
marcogario force-pushed the marcogario/filter_registries branch from 529f92f to 31d11b1 Compare January 14, 2025 14:29
aeisenberg
aeisenberg approved these changes Jan 14, 2025
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good. I have a suggestion, but it is purely stylistic and non-blocking.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/start-proxy-action.ts
Comment on lines +29 to +32
actions: "",
cpp: "",
go: "",
swift: "",

@aeisenberg aeisenberg Jan 14, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit:

Suggested change
actions: "",
cpp: "",
go: "",
swift: "",
actions: undefined,
cpp: undefined,
go: undefined,
swift: undefined,

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/start-proxy-action.ts
Comment on lines +212 to +214
const registryTypeForLanguage = language
? LANGUAGE_TO_REGISTRY_TYPE[language]
: undefined;

@aeisenberg aeisenberg Jan 14, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: If you apply the suggestion above, then this becomes simpler:

Suggested change
const registryTypeForLanguage = language
? LANGUAGE_TO_REGISTRY_TYPE[language]
: undefined;
const registryTypeForLanguage = LANGUAGE_TO_REGISTRY_TYPE[language];

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@marcogario marcogario Jan 15, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I still need the check on language itself, though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marcogario
marcogario merged commit 3b4f4d9 into main Jan 15, 2025
@marcogario
marcogario deleted the marcogario/filter_registries branch January 15, 2025 10:34
@github-actions github-actions Bot mentioned this pull request Jan 21, 2025
Merge main into releases/v3 #2708
Merged
5 of 8 tasks
@marcogario marcogario mentioned this pull request Jan 24, 2025
start-proxy: Fix bug when language is not provided #2723
Merged
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg aeisenberg approved these changes
@aibaars aibaars Awaiting requested review from aibaars

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@marcogario marcogario

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@marcogario @aeisenberg @github-advanced-security
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.