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

CompareId == 'undefined' #847

Closed
Joannazhx opened this issue Oct 15, 2020 · 3 comments · Fixed by #848
Closed

CompareId == 'undefined' #847

Joannazhx opened this issue Oct 15, 2020 · 3 comments · Fixed by #848

Comments

@Joannazhx
Copy link

Joannazhx commented Oct 15, 2020

Is your feature request related to a problem? Please describe.
Hi, Richard
I'm using the overrideBuildReleaseId and it works well. The only issue is, it could only be assigned an int to it.
Could you set a condition in overrideBuildReleaseId that could help me turn on/ off overrideBuildReleaseId in YAML template?

if overrideBuildReleaseId = 'undefined' 
    #do nothing (won't overwrite checkstage setting)
else overrideBuildReleaseId = (int)
   get work items between {comparebuild id} and {current build id}

In this case, I could use the pipeline input variable to choose to turn on/off overrideBuildReleaseId option
overrideBuildReleaseId = $(input)
the input could be 'undefined' or build-id we want to compare with

Thanks a lot for your help!

All the best,
Joanna

@rfennell
Copy link
Owner

Sorry I have read this a few times and don't understand the request.

As it stands the the following is true

overrideBuildReleaseId Value result
Undefined Old behaviour, looks for last successful build using optional stage and tag filters
Empty string Old behaviour, looks for last successful build using optional stage and tag filters
A valid build ID (int) Use the build ID as the comparison
An invalid build ID (int) If a valid build cannot be found then the task exits with a message
Any other non empty input value The task exits with an error meesage

The key design guideline here is that this overrideBuildReleaseId is an exceptional value - it is only used with care by an administrator who understands the implications and ONLY wants to compare against a known fixed build/release. If this build/release cannot be found then no processing should occur. I don't want someone to stumble into enabling this feature within intending to.

So can you not switch the feature on or off by passing a value build ID or not ( passing undefined or empty string) ?

Or have you found a case where my actually logic does not match the above?

@Joannazhx
Copy link
Author

Joannazhx commented Oct 15, 2020

Thanks, Richard.
This one is what I'm looking for:

overrideBuildReleaseId Value result
Empty string Old behavior looks for last successful build using optional stage and tag filters

Didn't know that I could assign an empty string to overrideBuildReleaseId
It just works as I expected! Maybe you could add this information to the wiki page.

Thanks a lot.

@rfennell rfennell self-assigned this Oct 15, 2020
@rfennell
Copy link
Owner

I will push out a documentation update to the marketplace and the WIKI today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants