Skip to content

Commit

Permalink
Check for uncommited changes, write JSON output in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentezw committed Nov 15, 2023
1 parent 2bff9fc commit 883fef0
Show file tree
Hide file tree
Showing 11 changed files with 320 additions and 75 deletions.
18 changes: 18 additions & 0 deletions .changeset/slimy-sloths-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@shopify/cli-hydrogen': minor
---

The `deploy` command now displays an error if there are uncommited changes in a project's Git repository. If you'd like to go ahead with the deployment regardless, you can use the new `force` flag.
When deploying with uncommited changes, we use a default description in the form of `<sha> with additional changes` (where `<sha>` represents the hash of the last commit). This description will be visible in the Shopify Admin for the deployment, and the `metadata-description` flag can be used to specify a different description.

In CI environments, the `deploy` command now creates a file "h2_deploy_output.log" file in the current working directory, for successful deployments. This file holds a JSON object with the URL of the deployment. This can be useful for scripting purposes, where consequent steps in your CI workflow require the deployment URL. The flag `--no-json-output` can be used to prevent this behaviour. In the future, we may add further keys to the JSON object.

Updated internal dependencies for bug resolution.
Please update the `@shopify/cli` dependency in your app to avoid duplicated subdependencies:

```diff
"dependencies": {
- "@shopify/cli": "3.50.2",
+ "@shopify/cli": "3.51.0",
}
```
2 changes: 1 addition & 1 deletion examples/customer-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@remix-run/react": "2.1.0",
"@remix-run/server-runtime": "2.1.0",
"@shopify/cli": "3.50.2",
"@shopify/cli": "3.51.0",
"@shopify/cli-hydrogen": "^6.0.0",
"@shopify/hydrogen": "^2023.10.0",
"@shopify/remix-oxygen": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"devDependencies": {
"@remix-run/dev": "2.1.0",
"@remix-run/eslint-config": "2.1.0",
"@shopify/cli": "3.50.2",
"@shopify/cli": "3.51.0",
"@shopify/cli-hydrogen": "^6.0.2",
"@types/compression": "^1.7.2",
"@types/express": "^4.17.17",
Expand Down
108 changes: 54 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@
"required": false,
"multiple": false
},
"force": {
"name": "force",
"type": "boolean",
"char": "f",
"description": "Allows a deployment to proceed if there are uncommited changes in the Git repository.",
"required": false,
"allowNo": false
},
"path": {
"name": "path",
"type": "option",
Expand Down Expand Up @@ -199,6 +207,13 @@
"required": false,
"multiple": false
},
"metadata-description": {
"name": "metadata-description",
"type": "option",
"description": "Description of the changes in the deployment. Defaults to the commit message of the latest commit if there are no uncommited changes.",
"required": false,
"multiple": false
},
"metadata-url": {
"name": "metadata-url",
"type": "option",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"@ast-grep/napi": "0.11.0",
"@graphql-codegen/cli": "5.0.0",
"@oclif/core": "2.11.7",
"@shopify/cli-kit": "3.50.2",
"@shopify/cli-kit": "3.51.0",
"@shopify/hydrogen-codegen": "^0.1.0",
"@shopify/mini-oxygen": "^2.2.3",
"@shopify/oxygen-cli": "2.6.1",
"@shopify/oxygen-cli": "2.6.2",
"ansi-escapes": "^6.2.0",
"diff": "^5.1.0",
"fs-extra": "^11.1.0",
Expand Down
Loading

0 comments on commit 883fef0

Please sign in to comment.