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

Link uses api client config as fallback #3642

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

alvaro-shopify
Copy link
Contributor

WHY are these changes introduced?

Last days users are reporting that the cli is returning this error when running whatever app command

╭─ error ─────────────────────────────────────────────────╮
│                                                         │
│  Fix a schema error in shopify.app.my-config.toml:      │
│  [                                                      │
│    {                                                    │
│      "code": "invalid_type",                            │
│      "expected": "string",                              │
│      "received": "undefined",                           │
│      "path": [                                          │
│        "name"                                           │
│      ],                                                 │
│      "message": "Required"                              │
│    },                                                   │
│    {                                                    │
│      "code": "invalid_type",                            │
│      "expected": "object",                              │
│      "received": "undefined",                           │
│      "path": [                                          │
│        "auth"                                           │
│      ],                                                 │
│      "message": "Required"                              │
│    },                                                   │
│    {                                                    │
│      "code": "invalid_type",                            │
│      "expected": "object",                              │
│      "received": "undefined",                           │
│      "path": [                                          │
│        "webhooks"                                       │
│      ],                                                 │
│      "message": "Required"                              │
│    },                                                   │
│    {                                                    │
│      "code": "invalid_type",                            │
│      "expected": "string",                              │
│      "received": "undefined",                           │
│      "path": [                                          │
│        "application_url"                                │
│      ],                                                 │
│      "message": "Required"                              │
│    },                                                   │
│    {                                                    │
│      "code": "invalid_type",                            │
│      "expected": "boolean",                             │
│      "received": "undefined",                           │
│      "path": [                                          │
│        "embedded"                                       │
│      ],                                                 │
│      "message": "Required"                              │
│    }                                                    │
│  ]                                                      │
│                                                         │
╰─────────────────────────────────────────────────────────╯

An example here

The issue was introduced in the version 3.56.0 by this PR

Most of the app commands runs the link logic under the hood to sync the local config with the remote one as a first step. The problem is that there are lot of apps that doesn't have any active app version so the final configuration written in the toml in these scenarios is invalid.

Before the versioned app config project was rolled out, a backfill process was run for the most important/installed apps. This process created a new app version using the API Client configuration to populate the configuration app modules.
However, there are bunch of apps that the process didn't include in that first stage. In the following weeks the process will be executed for the rest of apps.

In the meantime we need a fix for any app that doesn't have any app version or the existing ones don't include any configuration app module

WHAT is this pull request doing?

  • link logic is using the API Client configuration content as a fallback in case the app doesn't have any app version

How to test your changes?

  • Run any app command for an old remote app that doesn't include any configuration app modules. They execution should succeed
  • Run any app command for an old remote app that includes some configuration app modules. They execution should succeed

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've made sure that any changes to dev or deploy have been reflected in the internal flowchart.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Apr 2, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.02% (+0.01% 🔼)
6768/9398
🟡 Branches
69.1% (-0.09% 🔻)
3316/4799
🟡 Functions
70.82% (+0.08% 🔼)
1806/2550
🟡 Lines
73.17% (+0.02% 🔼)
6382/8722
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / link.ts
95.83% (-4.17% 🔻)
72.58% (-16.61% 🔻)
100%
95.65% (-4.35% 🔻)
🟢
... / breakdown-extensions.ts
96.33% (-0.87% 🔻)
82.69% (-2.09% 🔻)
100% 100%
🔴
... / partners-client.ts
22.47% (-0.52% 🔻)
44.44% (-5.56% 🔻)
16.28%
21.84% (-0.25% 🔻)

Test suite run success

1620 tests passing in 755 suites.

Report generated by 🧪jest coverage report action from 838aee3

The new backend won't support apps without active versions.
Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

Tested that it works ✅

Could you take care of reverting this PR once the backfill process finishes? 🙏

Copy link
Contributor

@amcaplan amcaplan left a comment

Choose a reason for hiding this comment

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

Please add a patch changeset before merging!

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.

3 participants