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

New cli command to manage deployment previews configuration #3541

Merged
merged 14 commits into from
Jun 19, 2024

Conversation

CarlosCortizasCT
Copy link
Contributor

@CarlosCortizasCT CarlosCortizasCT commented May 27, 2024

Summary

Start work towards improving the Custom Applications deployment previews feature by adding a new command which will allow consumers to create/update deployments previews from the command line using our existing mc-scripts cli.

Description

There are internal teams with some challenges that could greatly benefit of having a better non-human interaction integration with Custom Applications deployment previews.
We do currently support this feature by manually adjusting some configuration in the Merchant Center UI, but it would be great if that configuration could be automatically updated from CI when a new feature-branch in created in a repository.

In order to achieve that we need to tackle different things but, as part of our X&X days, I wanted to start with this one which would allow for a logged-in user to create or update a new Custom Application deployment preview using the CLI:

# mc-scripts deployment-previews:set --alias my-alias --url https://www.nowhere.com

(if the arguments are not provided, the command will prompt for them)

This could allow consumers to automatically trigger from their CI the creation/update of a Custom Application deployment preview for any given created branch without human intervention.

This steps still required a CLI logged-in user to run this command, but it's a first step towards the end goal.

Copy link

vercel bot commented May 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mc-app-kit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2024 7:48am
merchant-center-application-kit-components-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2024 7:48am

Copy link

changeset-bot bot commented May 27, 2024

🦋 Changeset detected

Latest commit: 7f7ca83

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@commercetools-frontend/mc-scripts Minor
@commercetools-applications/merchant-center-template-starter-typescript Minor
@commercetools-applications/merchant-center-template-starter Minor
@commercetools-applications/merchant-center-custom-view-template-starter-typescript Minor
@commercetools-applications/merchant-center-custom-view-template-starter Minor
@commercetools-local/playground Minor
@commercetools-backend/eslint-config-node Minor
@commercetools-backend/express Minor
@commercetools-backend/loggers Minor
@commercetools-frontend/actions-global Minor
@commercetools-frontend/application-components Minor
@commercetools-frontend/application-config Minor
@commercetools-frontend/application-shell-connectors Minor
@commercetools-frontend/application-shell Minor
@commercetools-frontend/assets Minor
@commercetools-frontend/babel-preset-mc-app Minor
@commercetools-frontend/browser-history Minor
@commercetools-frontend/codemod Minor
@commercetools-frontend/constants Minor
@commercetools-frontend/create-mc-app Minor
@commercetools-frontend/cypress Minor
@commercetools-frontend/eslint-config-mc-app Minor
@commercetools-frontend/i18n Minor
@commercetools-frontend/jest-preset-mc-app Minor
@commercetools-frontend/jest-stylelint-runner Minor
@commercetools-frontend/l10n Minor
@commercetools-frontend/mc-dev-authentication Minor
@commercetools-frontend/mc-html-template Minor
@commercetools-frontend/notifications Minor
@commercetools-frontend/permissions Minor
@commercetools-frontend/react-notifications Minor
@commercetools-frontend/sdk Minor
@commercetools-frontend/sentry Minor
@commercetools-frontend/url-utils Minor
@commercetools-local/visual-testing-app Minor
@commercetools-website/components-playground Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CarlosCortizasCT CarlosCortizasCT added the 🚧 Status: WIP Work in progress label May 27, 2024
@CarlosCortizasCT CarlosCortizasCT removed 🚧 Status: WIP Work in progress labels May 27, 2024
@CarlosCortizasCT CarlosCortizasCT self-assigned this May 27, 2024
@CarlosCortizasCT CarlosCortizasCT marked this pull request as ready for review May 27, 2024 16:46
@CarlosCortizasCT CarlosCortizasCT requested a review from a team as a code owner May 27, 2024 16:46
Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks a lot for picking this up and taking the first steps! ❤️

Looks good overall, I left some minor suggestions / comments.

@@ -197,6 +198,43 @@ async function run() {
}
);

// Command: deployment-previews:push
const usageDeploymentPreviewsPush =
'Creates or updates a deployment preview for the customization application.';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Only Custom Applications support deployment previews. We can maybe be more specific.

Suggested change
'Creates or updates a deployment preview for the customization application.';
'Creates or updates a deployment preview for the Custom Application.';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was intentionally general because I think we need to to support deployment previews in Custom Views as well.

That's something we had in that's feature plan but left out of the first iteration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have a separate discussion about this as I'm not sure it's something we can easily support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message updated here: e624165

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one hasn't been updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about it.

Updated here: adf3d47

packages/mc-scripts/src/cli.ts Outdated Show resolved Hide resolved
packages/mc-scripts/src/cli.ts Outdated Show resolved Hide resolved
Copy link

gitstream-cm bot commented Jun 18, 2024

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

Copy link

gitstream-cm bot commented Jun 18, 2024

🥷 Code experts: no user matched threshold 10

See details

To learn more about /:\ gitStream - Visit our Docs

Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to go from side 🙌

Please also provide a changeset 🙏

@@ -197,6 +198,43 @@ async function run() {
}
);

// Command: deployment-previews:push
const usageDeploymentPreviewsPush =
'Creates or updates a deployment preview for the customization application.';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one hasn't been updated?

Copy link
Contributor

@kark kark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🙇‍♂️
I pulled the changes and tested them locally. Both creating and updating a deployment preview using deployment-previews:set work perfectly.

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

Successfully merging this pull request may close these issues.

5 participants