Skip to content

Allow picking up credentials from environment variables - #629

Merged
keynmol merged 6 commits into
mainfrom
pick-up-credentials
Aug 7, 2023
Merged

keynmol merged 6 commits into
mainfrom
pick-up-credentials

Conversation

@keynmol

@keynmol keynmol commented Aug 7, 2023 •

Copy link
Copy Markdown
Contributor
  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
Comment thread build.sbt Outdated
.addDependencies(deps: _*)
.addDependencies(provided: _*)

if (!sys.env.contains("COURSIER_REPOSITORIES")) {

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.

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
Copy Markdown
Contributor

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
Copy Markdown
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 👍

@olafurpg olafurpg 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.

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.

2 participants