-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Overwrite featureId during packaging #909
base: main
Are you sure you want to change the base?
Conversation
const parts = constraint.properties.featureId.split("."); | ||
parts[1] = extensionId; | ||
const newFeatureId = parts.join("."); | ||
constraint.properties.featureId = newFeatureId; |
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.
Are there any cases where people opt into someone else's feature Id? Say, the Microsoft new Boards Hub feature?
I haven't personally used these IDs, so there might be cases that we must keep in mind.
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.
And I suspect the publisher may also be overwritten here.
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.
Looks like ideally we'd loop over the feature contributions and then only overwrite the ones that match the same name at least.
https://github.com/gustavobergamim/azdevops-pipeline-approval/blob/master/vss-extension.json#L62-L99
await updateExtensionManifestsTaskIds(manifestPaths, tasksIds); | ||
} | ||
|
||
if (extensionTag && updateFeatureConstraints) { |
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.
if extensionId || extentionTag || publisherId
@@ -7,6 +7,7 @@ import { AzureRMEndpoint } from "azure-pipelines-tasks-azure-arm-rest/azure-arm- | |||
import fse from "fs-extra"; | |||
import uuidv5 from "uuidv5"; | |||
import tmp from "tmp"; | |||
import { forEach } from "core-js/core/array"; |
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.
Do we need this?
const parts = constraint.properties.featureId.split("."); | ||
parts[1] = extensionId; | ||
const newFeatureId = parts.join("."); | ||
constraint.properties.featureId = newFeatureId; |
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.
Looks like ideally we'd loop over the feature contributions and then only overwrite the ones that match the same name at least.
https://github.com/gustavobergamim/azdevops-pipeline-approval/blob/master/vss-extension.json#L62-L99
Sorry i was busy this weekend, haven't found time for it. But it is on my
list to wrap things up and test it.
…On Mon, 10 Jun 2024, 16:34 Jesse Houwing, ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In BuildTasks/Common/v5/Common.ts
<#909 (comment)>
:
> + }
+
+ const extensionTag = tl.getInput("extensionTag", false) || "";
+ const extensionId = `${(tl.getInput("extensionId", false) || manifest.id)}${extensionTag}`;
+
+ manifest.contributions
+ .filter((c: any) => c.constraints && c.constraints.length > 0)
+ .forEach((c: any) => {
+ c.constraints.forEach((constraint: any) => {
+ if (constraint.properties?.featureId) {
+ tl.debug(`Extension manifest featureId before: ${constraint.properties.featureId}`);
+
+ const parts = constraint.properties.featureId.split(".");
+ parts[1] = extensionId;
+ const newFeatureId = parts.join(".");
+ constraint.properties.featureId = newFeatureId;
Looks like ideally we'd loop over the feature contributions and then only
overwrite the ones that match the same name at least.
https://github.com/gustavobergamim/azdevops-pipeline-approval/blob/master/vss-extension.json#L62-L99
—
Reply to this email directly, view it on GitHub
<#909 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXC456AP2HIL4HFUY6QDCDZGW2RBAVCNFSM6AAAAABIU46IHKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMBXHE4DSMRVGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
No problem! The release pipeline is still broken anyway ;). I was just exploring github how people were using features in the manifest to make sure this change won't break anyone. |
@mmajcica stil have plans to carry this forward, or shall we convert this to a draft PR for now? |
In the contribution constraints, it is possible to reference the featureId's. FeatureId is composed of publisherId.extensionId.featureName. In case of extension tag being set, these fields do also need to be updated.
For further details check #172