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

Include Azure as a new MC target in configuration #3558

Merged
merged 6 commits into from
Jun 21, 2024

Conversation

CarlosCortizasCT
Copy link
Contributor

Summary

Include Azure as a new MC target in configuration.

Description

We add a new configuration option for Custom Applications and Custom Views so they can set the upcoming Azure production environment as a target.

@CarlosCortizasCT CarlosCortizasCT requested a review from a team as a code owner June 21, 2024 08:50
Copy link

changeset-bot bot commented Jun 21, 2024

🦋 Changeset detected

Latest commit: 397fa78

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/application-config Minor
@commercetools-backend/express Minor
@commercetools-frontend/application-components Minor
@commercetools-frontend/application-shell-connectors Minor
@commercetools-frontend/application-shell Minor
@commercetools-frontend/cypress Minor
@commercetools-frontend/mc-dev-authentication Minor
@commercetools-frontend/mc-html-template Minor
@commercetools-frontend/mc-scripts Minor
@commercetools-applications/merchant-center-template-starter-typescript Minor
@commercetools-applications/merchant-center-custom-view-template-starter-typescript Minor
@commercetools-local/visual-testing-app Minor
@commercetools-website/components-playground Minor
@commercetools-local/playground Minor
@commercetools-frontend/codemod Minor
@commercetools-frontend/react-notifications Minor
@commercetools-applications/merchant-center-template-starter Minor
@commercetools-applications/merchant-center-custom-view-template-starter Minor
@commercetools-frontend/permissions Minor
@commercetools-backend/eslint-config-node Minor
@commercetools-backend/loggers Minor
@commercetools-frontend/actions-global Minor
@commercetools-frontend/assets Minor
@commercetools-frontend/babel-preset-mc-app Minor
@commercetools-frontend/browser-history Minor
@commercetools-frontend/constants Minor
@commercetools-frontend/create-mc-app 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/notifications Minor
@commercetools-frontend/sdk Minor
@commercetools-frontend/sentry Minor
@commercetools-frontend/url-utils 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 Jun 21, 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 21, 2024 10:46am
merchant-center-application-kit-components-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 10:46am

Copy link

gitstream-cm bot commented Jun 21, 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
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.

We also need to map the values in the code:

  • for the application config:
    const mapCloudIdentifierToApiUrl = (
    key: (typeof CLOUD_IDENTIFIERS)[keyof typeof CLOUD_IDENTIFIERS]
    ): string => {
    switch (key) {
    case CLOUD_IDENTIFIERS.GCP_AU:
    return MC_API_URLS.GCP_AU;
    case CLOUD_IDENTIFIERS.GCP_EU:
    return MC_API_URLS.GCP_EU;
    case CLOUD_IDENTIFIERS.GCP_US:
    return MC_API_URLS.GCP_US;
    case CLOUD_IDENTIFIERS.AWS_FRA:
    return MC_API_URLS.AWS_FRA;
    case CLOUD_IDENTIFIERS.AWS_OHIO:
    return MC_API_URLS.AWS_OHIO;
    case CLOUD_IDENTIFIERS.AWS_CN:
    return MC_API_URLS.AWS_CN;
    default:
    // We would probably never get to this point, as the JSON schema validation
    // kicks in before.
    throw new Error(
    `Unknown cloud identifier "${key}". Supported values: ${Object.values(
    CLOUD_IDENTIFIERS
    ).toString()}`
    );
    }
    };
  • in the express middleware:
    const mapCloudIdentifierToIssuer = <Request extends TBaseRequest>(
    issuer: TSessionMiddlewareOptions<Request>['issuer']
    ): string | undefined => {
    switch (issuer) {
    case CLOUD_IDENTIFIERS.GCP_AU:
    return MC_API_URLS.GCP_AU;
    case CLOUD_IDENTIFIERS.GCP_EU:
    return MC_API_URLS.GCP_EU;
    case CLOUD_IDENTIFIERS.GCP_US:
    return MC_API_URLS.GCP_US;
    case CLOUD_IDENTIFIERS.AWS_FRA:
    return MC_API_URLS.AWS_FRA;
    case CLOUD_IDENTIFIERS.AWS_OHIO:
    return MC_API_URLS.AWS_OHIO;
    case CLOUD_IDENTIFIERS.AWS_CN:
    return MC_API_URLS.AWS_CN;
    default:
    return undefined;
    }
    };

@CarlosCortizasCT
Copy link
Contributor Author

We also need to map the values in the code:

  • for the application config:
    const mapCloudIdentifierToApiUrl = (
    key: (typeof CLOUD_IDENTIFIERS)[keyof typeof CLOUD_IDENTIFIERS]
    ): string => {
    switch (key) {
    case CLOUD_IDENTIFIERS.GCP_AU:
    return MC_API_URLS.GCP_AU;
    case CLOUD_IDENTIFIERS.GCP_EU:
    return MC_API_URLS.GCP_EU;
    case CLOUD_IDENTIFIERS.GCP_US:
    return MC_API_URLS.GCP_US;
    case CLOUD_IDENTIFIERS.AWS_FRA:
    return MC_API_URLS.AWS_FRA;
    case CLOUD_IDENTIFIERS.AWS_OHIO:
    return MC_API_URLS.AWS_OHIO;
    case CLOUD_IDENTIFIERS.AWS_CN:
    return MC_API_URLS.AWS_CN;
    default:
    // We would probably never get to this point, as the JSON schema validation
    // kicks in before.
    throw new Error(
    `Unknown cloud identifier "${key}". Supported values: ${Object.values(
    CLOUD_IDENTIFIERS
    ).toString()}`
    );
    }
    };
  • in the express middleware:
    const mapCloudIdentifierToIssuer = <Request extends TBaseRequest>(
    issuer: TSessionMiddlewareOptions<Request>['issuer']
    ): string | undefined => {
    switch (issuer) {
    case CLOUD_IDENTIFIERS.GCP_AU:
    return MC_API_URLS.GCP_AU;
    case CLOUD_IDENTIFIERS.GCP_EU:
    return MC_API_URLS.GCP_EU;
    case CLOUD_IDENTIFIERS.GCP_US:
    return MC_API_URLS.GCP_US;
    case CLOUD_IDENTIFIERS.AWS_FRA:
    return MC_API_URLS.AWS_FRA;
    case CLOUD_IDENTIFIERS.AWS_OHIO:
    return MC_API_URLS.AWS_OHIO;
    case CLOUD_IDENTIFIERS.AWS_CN:
    return MC_API_URLS.AWS_CN;
    default:
    return undefined;
    }
    };

Updated here: 397fa78

Copy link

gitstream-cm bot commented Jun 21, 2024

🥷 Code experts: emmenko

emmenko has most 👩‍💻 activity in the files.
emmenko has most 🧠 knowledge in the files.

See details

packages-backend/express/src/auth.ts

Activity based on git-commit:

emmenko
JUN
MAY
APR 3 additions & 3 deletions
MAR
FEB
JAN

Knowledge based on git-blame:
emmenko: 77%

packages-backend/express/src/constants.ts

Activity based on git-commit:

emmenko
JUN
MAY
APR
MAR
FEB
JAN

Knowledge based on git-blame:
emmenko: 91%

packages/application-config/src/constants.ts

Activity based on git-commit:

emmenko
JUN
MAY
APR
MAR
FEB
JAN

Knowledge based on git-blame:
emmenko: 68%

packages/application-config/src/utils.ts

Activity based on git-commit:

emmenko
JUN
MAY
APR
MAR
FEB
JAN

Knowledge based on git-blame:
emmenko: 96%

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

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 🙌

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.

🙌🏽

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.

Perfect, thanks!

@CarlosCortizasCT CarlosCortizasCT merged commit 5363548 into main Jun 21, 2024
21 checks passed
@CarlosCortizasCT CarlosCortizasCT deleted the cm-update-cloud-provider-config branch June 21, 2024 13:26
@ct-changesets ct-changesets bot mentioned this pull request Jun 21, 2024
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.

4 participants