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

[FIXED JENKINS-42858] Process credentials before rest of environment #141

Closed
wants to merge 2 commits into from

Conversation

@abayer
Copy link
Member

abayer commented Mar 17, 2017

  • JENKINS issue(s):
  • Description:
    • I don't think there's a reasonable use case for an environment variable being in the credentials ID, so there's really no reason not to do credentials first, is there? This allows credentials to be referenced by other environment variables.
    • Needs jenkinsci/credentials-binding-plugin#34 to be merged/released before we can actually move forward with this, due to withCredentials currently requiring a workspace.
  • Documentation changes:
    • n/a
  • Users/aliases to notify:
I don't think there's a reasonable use case for an environment
variable being in the credentials ID, so there's really no reason
*not* to do credentials first, is there? This allows credentials to be
referenced by other environment variables.
@abayer abayer added this to the 1.1.2 milestone Mar 17, 2017
@reviewbybees
Copy link

reviewbybees commented Mar 17, 2017

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@rsandell
Copy link
Member

rsandell commented Mar 21, 2017

Since we switched to expanding the environment to after the agent has been allocated there is no reason any more. It used to be needed because the withCredentials step requires a workspace.

withCredentialsBlock(thisStage.getEnvCredentials()) {
withEnvBlock(thisStage.getEnvVars(root, script)) {
if (evaluateWhen(thisStage.when)) {
inDeclarativeAgent(thisStage, root, thisStage.agent) {

This comment has been minimized.

Copy link
@rsandell

rsandell Mar 21, 2017

Member

🐛 withCredentials step requires a workspace so this will only work when there is a global agent allocated.

This comment has been minimized.

Copy link
@abayer

abayer Mar 21, 2017

Author Member

So it won't work with agent none even without this change?

This comment has been minimized.

Copy link
@abayer

abayer Mar 21, 2017

Author Member

Yup, I see it now. I've opened https://issues.jenkins-ci.org/browse/JENKINS-42999 (with a PR at jenkinsci/credentials-binding-plugin#34) to get withCredentials to stop requiring a workspace unless one or more of the MultiBindings passed to it requires a workspace itself.

This comment has been minimized.

Copy link
@abayer

abayer Mar 30, 2017

Author Member

That's in now, so yay.

@bitwiseman
Copy link
Contributor

bitwiseman commented Mar 22, 2017

@abayer

I don't think there's a reasonable use case for an environment variable being in the credentials ID

No, I can honestly say this not a safe assumption. People will have different credentials depending on possibly branch or other env var - "my-creds-for-${EXECUTION_ENVIRONMENT_NAME}".

This would a place where env var magical ordering is not as good as simple sequential evaluation.

@abayer
Copy link
Member Author

abayer commented Mar 22, 2017

@bitwiseman Ugggggh. Well, that's a pain.

@abayer
Copy link
Member Author

abayer commented Mar 30, 2017

Closed in favor the omnibus at #147

@abayer abayer closed this Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.