Skip to content

feat(cli): create deployment#2491

Merged
jorgemoya merged 8 commits intocanaryfrom
cli-deploy-create-deployment
Jul 23, 2025
Merged

feat(cli): create deployment#2491
jorgemoya merged 8 commits intocanaryfrom
cli-deploy-create-deployment

Conversation

@jorgemoya
Copy link
Copy Markdown
Contributor

What/Why?

  • Create a deployment with project_uuid and upload_uuid.
  • Reads project id from options, env vars, or .bigcommerce/project.json
  • Updated logic to throw errors so we can test for errors

Still missing: poll after deploy

Testing

Unit tests + locally
Screenshot 2025-07-22 at 2 47 36 PM

Migration

N/A

@jorgemoya jorgemoya requested a review from a team July 22, 2025 19:51
@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 22, 2025

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

Name Status Preview Comments Updated (UTC)
catalyst-canary ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 4:18pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
catalyst ⬜️ Ignored (Inspect) Jul 23, 2025 4:18pm
catalyst-au ⬜️ Ignored (Inspect) Jul 23, 2025 4:18pm
catalyst-b2b ⬜️ Ignored (Inspect) Jul 23, 2025 4:18pm
catalyst-uk ⬜️ Ignored (Inspect) Jul 23, 2025 4:18pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jul 22, 2025

⚠️ No Changeset found

Latest commit: 8269f96

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Copy Markdown
Contributor

@matthewvolk matthewvolk left a comment

Choose a reason for hiding this comment

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

A couple of notes to consider for the future, but this looks good. Thanks for switching to the try/catch pattern to bubble up errors 🙏

Comment thread packages/cli/src/commands/deploy.ts Outdated
Comment thread packages/cli/src/commands/deploy.ts
});

describe('bundle zip generation', () => {
describe('loadProjectId', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🍹 Might be able to ditch this set of tests if we switch to conf

Copy link
Copy Markdown
Contributor

@matthewvolk matthewvolk left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment thread packages/cli/src/commands/deploy.ts Outdated
Comment thread packages/cli/src/lib/project-config.ts Outdated
Comment on lines +22 to +30
getProjectId(): string {
const projectId = this.config.get('projectId');

if (!projectId) {
throw new Error(
'No `projectId` found in .bigcommerce/project.json. Please add a valid `projectId` (UUID) to your bigcommerce configuration file.',
);
}

return projectId;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🍹I wonder if we'd be able to do something like get(field: keyof ProjectConfigSchema) for a future where we might want to store more keys in project.json. Not necessary right now though!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a valid projectId (UUID) to your bigcommerce configuration file.

Can we just name the field projectUuid so we don't need to mention it's a uuid?

Copy link
Copy Markdown
Contributor Author

@jorgemoya jorgemoya Jul 23, 2025

Choose a reason for hiding this comment

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

I added generic get/set. I have also swapped the error to be more generic.

But now that you mentioned it, I'm fine with renaming projectUuid, should we use this throughout the CLI tho? Including command options, etc?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch - I'm down to switch the options to --project-uuid, and anywhere else it pops up

@jorgemoya jorgemoya added this pull request to the merge queue Jul 23, 2025
Merged via the queue into canary with commit 560f950 Jul 23, 2025
12 checks passed
@jorgemoya jorgemoya deleted the cli-deploy-create-deployment branch July 23, 2025 20:22
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