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

feat(create-mc-app): add cloudIdentifier flag #3564

Merged
merged 8 commits into from
Jul 10, 2024

Conversation

mustafaasif2
Copy link
Contributor

@mustafaasif2 mustafaasif2 commented Jul 3, 2024

Summary

Added a cloudIdentifier flag for Custom Applications and Custom Views

Description

The create-mc-app CLI now prompts the user about the region of their choice, defaulting to gcp-eu.

The option to define the region is also be possible via a CLI option, e.g. --cloud-identifier=gcp-au for programmatic usage.

Background

Installing one of the Merchant Center starter templates (customizations) results by default in using the GCP EU environment.

However, for customers using a different CoCo region it might get confusing if they forget to change the cloudIdentifier to the region of their choice.

Corresponding Jira Ticket: SHIELD-1300

@mustafaasif2 mustafaasif2 self-assigned this Jul 3, 2024
Copy link

changeset-bot bot commented Jul 3, 2024

🦋 Changeset detected

Latest commit: 8bda236

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/create-mc-app 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-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/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/mc-scripts 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/playground 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

Copy link

vercel bot commented Jul 3, 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 Jul 10, 2024 7:39am
merchant-center-application-kit-components-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 7:39am

@mustafaasif2
Copy link
Contributor Author

mustafaasif2 commented Jul 3, 2024

Some general questions:

  1. Is the pipeline failing because of my changes or is it supposed to fail in the development environment. The error message that shows up is "Error: The operation was canceled."
  2. I tried generating a changeset file, however, I was not completely sure on the options to select while creating one for these changes.

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 for looking into this! Congrats on your first PR 🥳 It looks really good 🤗

Some general questions:

  1. Is the pipeline failing because of my changes or is it supposed to fail in the development environment. The error message that shows up is "Error: The operation was canceled."

Yes, the pipeline step runs scripts/install-template.mjs script.
The cli prompts for cloud env, which is not provided in the script.

const createAppCmdResult = shelljs.exec(
[
binaryPath,
applicationName,
`--template=${templateName}`,
`--template-version=${branchName}`,
`--application-type=${applicationType}`,
`--initial-project-key=${initialProjectKey}`,
`--yes`,
'--skip-install',
].join(' '),
{ cwd: sandboxPath }

  1. I tried generating a changeset file, however, I was not completely sure on the options to select while creating one for these changes.

We use semantic versioning. A new feature (a non-breaking change) corresponds to a minor package update

packages/create-mc-app/src/constants.ts Outdated Show resolved Hide resolved
packages/create-mc-app/src/process-options.ts Show resolved Hide resolved
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 job so far, thanks! 🙌

packages/create-mc-app/src/process-options.ts Show resolved Hide resolved
…tion-config and added CLOUD_IDENTIFIER env variable
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.

Thanks again, everything looks good to me 🙌
Here are my final comments

packages/create-mc-app/src/validations.ts Outdated Show resolved Hide resolved
.changeset/great-rules-grin.md Outdated Show resolved Hide resolved
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.

Thanks, looks great 😊
2 final notes

.changeset/great-rules-grin.md Show resolved Hide resolved
packages/create-mc-app/src/cli.ts Outdated Show resolved Hide resolved
@mustafaasif2 mustafaasif2 requested a review from a team as a code owner July 5, 2024 10:49
@mustafaasif2 mustafaasif2 requested review from a team and emmenko and removed request for a team July 5, 2024 10:49
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.

Awesome work, thanks a lot! 🙌

All good from my side, just a minor naming suggestion.

packages/create-mc-app/src/validations.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Rhotimee Rhotimee left a comment

Choose a reason for hiding this comment

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

Nice work @mustafaasif2 🙌🏽

@emmenko emmenko merged commit 96eb231 into main Jul 10, 2024
20 checks passed
@emmenko emmenko deleted the SHIELD-1300-add-cloudIdentifier-flag branch July 10, 2024 09:18
@ct-changesets ct-changesets bot mentioned this pull request Jul 10, 2024
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.

4 participants