FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Filter registry credentials by language by marcogario · Pull Request #2680 · github/codeql-action · GitHub

Filter registry credentials by language - #2680

Merged
marcogario merged 3 commits into
mainfrom
marcogario/filter_registries
Jan 15, 2025
Merged

marcogario merged 3 commits into
mainfrom
marcogario/filter_registries

Conversation

marcogario commented Jan 10, 2025
edited
Loading

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.

marcogario self-assigned this Jan 10, 2025
Comment thread src/start-proxy-action.ts Fixed
marcogario force-pushed the marcogario/filter_registries branch 2 times, most recently from 4263e13 to 0e7e3db Compare January 13, 2025 10:44
Comment thread src/start-proxy-action.ts Fixed
marcogario force-pushed the marcogario/filter_registries branch from 0e7e3db to e02d65a Compare January 13, 2025 10:52
marcogario force-pushed the marcogario/filter_registries branch from d9e8b07 to de0f9cf Compare January 13, 2025 16:15
marcogario marked this pull request as ready for review January 13, 2025 16:17
marcogario requested a review from a team as a code owner January 13, 2025 16:17
marcogario requested review from aibaars and removed request for a team January 13, 2025 16:20
Comment thread src/start-proxy-action.ts Outdated
const KEY_EXPIRY_YEARS = 2;

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

marcogario force-pushed the marcogario/filter_registries branch from f33e08c to 529f92f Compare January 14, 2025 14:21
Comment thread src/start-proxy-action.ts Fixed
Comment thread src/start-proxy-action.ts Fixed
Comment thread src/start-proxy-action.ts Fixed
Comment thread src/start-proxy-action.ts Fixed
marcogario force-pushed the marcogario/filter_registries branch from 529f92f to 31d11b1 Compare January 14, 2025 14:29

aeisenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit:

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I still need the check on language itself, though.

marcogario merged commit 3b4f4d9 into main Jan 15, 2025
marcogario deleted the marcogario/filter_registries branch January 15, 2025 10:34
github-actions Bot mentioned this pull request Jan 21, 2025
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL