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

Overwrite featureId during packaging #909

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mmajcica
Copy link

@mmajcica mmajcica commented Jun 2, 2024

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

@mmajcica mmajcica requested a review from jessehouwing as a code owner June 2, 2024 09:28
Mario Majcica added 3 commits June 2, 2024 11:31
const parts = constraint.properties.featureId.split(".");
parts[1] = extensionId;
const newFeatureId = parts.join(".");
constraint.properties.featureId = newFeatureId;
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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) {
Copy link
Collaborator

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";
Copy link
Collaborator

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;
Copy link
Collaborator

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

@mmajcica
Copy link
Author

mmajcica commented Jun 10, 2024 via email

@jessehouwing
Copy link
Collaborator

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.

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.

@jessehouwing
Copy link
Collaborator

@mmajcica stil have plans to carry this forward, or shall we convert this to a draft PR for now?

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

Successfully merging this pull request may close these issues.

2 participants