-
Notifications
You must be signed in to change notification settings - Fork 431
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
Support build info restoring when using Pipeline Artifacts #937
Conversation
Also fix the typo arifacts :D |
Thanks for the PR, it is interesting you are moving to pipelines for build, but not for releases. I will have a proper look as soon as I can. Initial look is that it certainly addresses a key need |
I have run it though my test harnesses and it seems OK to me. I will get it published, it will be 3.43.x Thanks again for the PR |
Okay, maybe I spoke to soon, my final tests are showed an issue. My new test pipeline is very simple, it has one task
This new artifact is add to my existing test release, but when it runs it throws the error on runs other than the first run (when there is only one version of the artifact)
I want to check into why there is 'There was a problem getting the details of the CS/WI for the build Error: VS800075: The project with id 'No project was specified.' does not exist, or you do not have permission to access it.' before I release the update. |
I found the problem and have sorted it in PR #938, it was down to the project ID being in a different location for my test run, it check your and my locations. |
What problem does this PR address?
We're trying to migrate our things to store from
Build Artifacts
toPipeline Artifacts
(Universal packages
actually) for better permission control, see Overview of Artifacts in Azure Pipelines.However, as of XplatGenerateReleaseNotes@3.42.2, the
artifactInThisRelease.artifactType === "Build"
is checked before getting build info from CI pipeline, which make the Pipeline Artifacts be bypassed with no commit and work item info.I'm not trying to change those logic, but instead, to "hack" and restore the original build pipeline info before getting into those parts with the introduced function
restoreAzurePipelineArtifactsBuildInfo(artifactsInRelease: SimpleArtifact[], webApi: WebApi)
.Implementation
Main logic of this PR: To
restore build info
for i.artifactsInThisRelease
and ii.artifactsInMostRecentRelease
.The actual tricky I do is to extract the projectId and feedId for the
Artifact Details - Get Package
API to get the versionId.And then use those ids to get the original build pipeline info with
Artifact Details - Get Package Version Provenance
API.The
packageVersionId
is got by setting theincludeAllVersions
as TRUE (which is false by default) to query all versions and then find with matchingversion.normalizedVersion === packageVersion
.There are two places that require the restoring, including the
arifactsInThisRelease
andarifactsInMostRecentRelease
, while the former one also NEEDS to update thebuildId
as well for the later usages.Notes
version.normalizedVersion === packageVersion
I used for checking the version should usenormalizedVersion
or justversion
because they are the same string in this case; however, as the document mentioned, theversion
stands for Display version and might not be a unique one or what.azure-devops-node-api@10.2.1
, thePackagingApi
(or maybe theFeedApi
in Python) is not yet be supported; therefore, I have to handcraft one (marked asFIXME #937
).2.
says, the entry point for Azure DevOps API is calledPackaging
by Microsoft but the one used in Python SDK is calledFeed
, which is not yet exists in Node's SDK; therefore, the naming may change when available."7a20d846-c929-4acc-9ea2-0d5a7df1b197"
forgetPackage()
and the"0aaeabd4-85cd-4686-8a77-8d31c15690b8"
forgetPackageVersionProvenance()
could be got via EITHER:a. The functions
get_package()
andget_package_version_provenance()
provided in Python's feed_client , ORb.
GET /resourceAreas
and thenOPTIONS /Packaging
, e.g.,curl https://dev.azure.com/LouisSung-Demo/_apis/resourceAreas
followed bycurl -X OPTIONS https://feeds.dev.azure.com/LouisSung-Demo/_apis/Packaging