-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
DownloadBuildArtifacts - Use latest build filtered by branch #6356
Conversation
|
Thanks, great ideas! I'll try to implement them next week and update the PR! |
Just updated the PR with an updated UI. Regarding 2), I chose a slightly different approach by using a combo to only show one of the two inputs (branche-name or build-id) because you would never use them in conjunction. Let me know if you find this better or if I can still improve the UI experience / labels... |
|
Tasks/DownloadBuildArtifacts/main.ts
Outdated
@@ -126,12 +128,28 @@ async function main(): Promise<void> { | |||
// Triggering build info not found, or requested, default to specified build info | |||
projectId = tl.getInput("project", true); | |||
definitionId = definitionIdSpecified; | |||
buildId = parseInt(tl.getInput("buildId", true)); | |||
buildId = parseInt(tl.getInput("buildId", false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should make sure buildId is specified when the option chosen is specific build.
Tasks/DownloadBuildArtifacts/main.ts
Outdated
} | ||
} | ||
|
||
// verify that buildId belongs to the definition selected | ||
if (definitionId) { | ||
if (!buildId){ | ||
// get latest successful build filtered by branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should do this only when "latest build" option is chosen
Agree! Done! |
Any idea when this will be available for everyone generally? Killer feature for my use case right now and something I've been missing from VSTS. |
@keesschollaart81 Instead of using “Download artifacts produced by” parameter with radio buttons, we can have “Artifact version” as the parameter name with a drop down. And the dropdown can have below entries.
Discussed the same with @GitHubSriramB and this will be the final set of changes :). |
Great! Like it, done! |
@keesschollaart81 - one last comment reg. the name for the name for the version input. Instead of naming it "Artifact version", can you name it as "Build version to download"? Since there are artifacts within a Build & the version we are providing as input is for the Build that is applicable for all the artifacts, wanted to avoid naming it as "Artifact version" & causing any confusion. already discussed this suggestion with @ashokirla and he is fine with this too. |
Tasks/DownloadBuildArtifacts/main.ts
Outdated
console.log(tl.loc("LatestBuildFound", buildsForThisDefinition[0].id)); | ||
buildId = buildsForThisDefinition[0].id | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we reuse the build we got in case version is latest or latestFromBranch instead of calling getBuild again in line 156?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, nice catch! Implemented & tested!
…oad + perf optmization
Again... 👍 |
@@ -68,9 +68,9 @@ | |||
"helpMarkDown": "If checked, this build task will try to download artifacts from the triggering build. If there is no triggering build from the specified definition, it will download artifacts from the build specified in the options below." | |||
}, | |||
{ | |||
"name": "artifactVersion", | |||
"name": "buildVersionToDownload", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
folks only see the label. Is there a reason to rename the name? It will cause the tasks to get redownloaded since I believe the folder is by name + guid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean to yaml and all our docs and templates? Is this rename really worth it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a naming change of a field that is added as part of this feature (initially implemented by me, named 'artifactVersion'). On top of that, this is only a renaming of this parameter, not the renaming of the whole step. I dont think this is breaking in any way. With this, I dont see how this affects the yaml/docs... Or am I missing something here?
Tasks/DownloadBuildArtifacts/main.ts
Outdated
console.log(tl.loc("LatestBuildFound", build.id)); | ||
buildId = build.id | ||
} | ||
if (!build){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave blank line after previous if block
With Sprint 131 now being rolled out, the addition of this capability as a build task would significantly reduce the number of custom scripts that are currently in place to perform the same task. |
@drewkg This feature will be deployed with M133 changes. |
Thanks for the timeline. |
@omeshp what does M133 mean? Where can I find a reference to that, or an actual time frame? |
@leidegre: VSTS deploys fixes and features generally on a 3 week cadence/sprints. Currently deployed version in production is M131 (milestone 131): https://docs.microsoft.com/en-us/vsts/release-notes/2018/mar-05-vsts. M133 will start deploying after April 15th. We do a staged rollout - generally within 2 weeks all the VSTS accounts will have the updates. Thanks, |
The version 0.131.1 of Download Build Artifacts shows the Build picklist as version numbers in the Release Definition UI and currently does not appear to allow variables to be used as the 'buildId' input:- specify a variable with target version number:-
can you confirm if the 'buildVersionToDownload' input in this version of Download Build Artifacts will accept a version number variable? |
Is it possible somehow to obtain the value of the "build.sourceLabel" artifact (preferably available as a variable) together with the new option to always use the latest build version available? Background: we have a CI build publishing an artifact. Using another build definition we collect this artifact (using this build task) and generate a product package (MSI etc.). We need the version number of the CI build output to be set as the version number of this build definition (and the MSI). I was thinking of using ##vso[build.updatebuildnumber] for this accompanied with the value of "build.sourceLabel". |
This got installed on our account this week, this increases our productivity, thanks for the effort! |
Is there any way to update this task for OnPrem TFS 2018? I really need this feature to fix our releases... |
@thecontrarycat The checkbox "When appropriate, download artifacts from triggering build" option won't work for you. This was released after the TFS 2018 was shipped and hence, it's available only for the online users as of now or the TFS 2018 update 2 users. If you are okay with this, let me know. I will give you the steps to update the task. |
@keesschollaart81 |
I don't know, what do @GitHubSriramB or @ashokirla think? I wont be able to implement this in the next 6 weeks, at least. Why don't you pop a PR yourself? ;-) |
Implements #6076