Skip to content

Allow picking up credentials from environment variables #629

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

Merged
merged 6 commits into from
Aug 7, 2023

Conversation

keynmol
Copy link
Contributor

@keynmol keynmol commented Aug 7, 2023

  1. Remove .noCredentials configuration, which was a copypaste
  2. Fix handling of COURSIER_REPOSITORIES, allowing for full control of fetching repositories via this env variable
  3. Update coursier to 2.1.x to fix a bug where COURSIER_CREDENTIALS as string was ignored, see fix: ensure env creds from file are read correctly coursier/coursier#2242
  4. Ensure all resolving tasks use the same cache
  5. Add end-to-end tests by starting a local password protected server and pointing coursier at that

Test plan

Manual testing, automated seems to be quite hard to setup (but I will try, still)

@keynmol keynmol marked this pull request as ready for review August 7, 2023 14:10

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
.addDependencies(deps: _*)
.addDependencies(provided: _*)

if (!sys.env.contains("COURSIER_REPOSITORIES")) {
Copy link
Member

Choose a reason for hiding this comment

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

FYI: app.env.environmentVariables should have a copy of environment variables, which can be overridden for e2e tests of the scip-java CLI. Not something we need to think about right now, but one of the core ideas in Moped is that you inject all system dependencies via Application for cleaner testing.

"COURSIER_CREDENTIALS" -> s"localhost $Username:$Password"
)

val tmp = os.temp.dir(prefix = "scip-java")
Copy link
Member

Choose a reason for hiding this comment

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

FYI, we use FileLayout.fromString(..., root = workingDirectory) in BaseBuildToolSuite, which makes it easier to create big directory structures without multiple os.write(...) invocations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll punt this to the next PR for sure 👍

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻 Very nice!

@keynmol keynmol enabled auto-merge (squash) August 7, 2023 14:42
@keynmol keynmol merged commit 0fe40e9 into main Aug 7, 2023
@keynmol keynmol deleted the pick-up-credentials branch August 7, 2023 14:47
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.

None yet

2 participants