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/cli/appmanager/refactoring-commands #2450

Merged

Conversation

eikeland
Copy link
Contributor

Why

Refactoring of publish commands and helpers.

Copy link

changeset-bot bot commented Sep 12, 2024

⚠️ No Changeset found

Latest commit: 015bf18

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

@github-actions github-actions bot added 🐞 bug Something isn't working 👨🏻‍🍳 cookbooks 💾 CLI fusion framework CLI 📚 documentation Improvements or additions to documentation 🚀 feature New feature or request labels Sep 12, 2024
@eikeland eikeland force-pushed the feat/cli/appmanager/refractoring-commands branch from f450dbc to 34c5f67 Compare September 12, 2024 11:41
@eikeland eikeland self-assigned this Sep 12, 2024
@eikeland eikeland marked this pull request as ready for review September 12, 2024 12:11
@eikeland eikeland requested review from odinr and a team as code owners September 12, 2024 12:11
Copy link
Contributor

github-actions bot commented Sep 12, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 0.39% 1633 / 412061
🔵 Statements 0.39% 1633 / 412061
🔵 Functions 23.17% 209 / 902
🔵 Branches 36.1% 374 / 1036
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
cookbooks/app-react/app.config.ts 0% 0% 0% 0% 1-12
packages/cli/src/bin/create-dev-serve.ts 0% 0% 0% 0% 1, 7, 9-10, 12, 14-16, 18-21, 23-29, 31, 41-42, 44, 46-47, 49-53, 55, 58-59, 61-63, 65, 67-128, 130-131, 133-137, 139, 141, 143, 145-148, 150, 152-163
packages/cli/src/bin/create-export-config.ts 0% 0% 0% 0% 1-4, 6-7, 16, 20-21, 23, 30-31, 33, 35-36, 38-42, 44-46, 48-63, 65-66, 68-78, 80-82, 84-85, 87-88, 90-95, 97-98, 100-108, 110-116, 118-119, 121-133, 135-142, 144-145, 147
packages/cli/src/bin/publish-application.ts 0% 0% 0% 0% 1-4, 12, 15, 17, 21-22, 24, 26-27, 29-30, 32-33, 35-40, 42-43, 45-55, 57-63, 65, 67-68, 70-73, 75-78, 80, 82-86, 88-95, 97, 99, 101-109, 111-112, 114-121, 123-132, 134-138
packages/cli/src/bin/tag-application.ts 0% 0% 0% 0% 1-5, 8-11, 13, 18-19, 21, 23-26, 28-30, 32-33, 35-36, 38-43, 45-46, 48-58, 60-66, 68-78, 80-92
packages/cli/src/bin/upload-application.ts 0% 0% 0% 0% 1-5, 8, 12-13, 15, 17-18, 20-21, 23-24, 26-31, 33-35, 37-39, 41-48, 50-56, 58-62, 64-67, 69, 71, 73-83
packages/cli/src/bin/utils/getEndpointUrl.ts 0% 0% 0% 0% 1, 3, 10-17, 19-22, 24-26, 28-35, 37-39, 41-45, 47-49, 51-52, 54-56
packages/cli/src/bin/utils/index.ts 0% 0% 0% 0% 1
packages/cli/src/bin/utils/isAppRegistered.ts 0% 0% 0% 0% 1, 6-12, 14-18, 20-24, 26-27
packages/cli/src/bin/utils/publishAppConfig.ts 0% 0% 0% 0% 1, 3, 9-18, 20-28, 30-31
packages/cli/src/bin/utils/requireToken.ts 0% 0% 0% 0% 1, 3-10
packages/cli/src/bin/utils/tagAppBundle.ts 0% 0% 0% 0% 1, 6-15, 17-21, 23-27, 29-30
packages/cli/src/bin/utils/uploadAppBundle.ts 0% 0% 0% 0% 1, 3, 8-12, 14-18, 20-27, 29-33, 35-37, 39-43, 45-47, 49-53, 55-56
packages/cli/src/lib/app-manifest.ts 0% 0% 0% 0% 1-2, 4, 13, 15, 40-41, 43, 60-61, 63-66, 68-79, 81, 89-97, 99-101, 103, 106-108, 110-120, 122-138, 140-146, 148-164, 166-183
packages/modules/http/src/module.ts 25% 100% 0% 25% 67-76, 78-90, 97-101, 115-122
Generated in workflow #7625

@eikeland eikeland force-pushed the feat/cli/appmanager/refractoring-commands branch from 1049a48 to 1a48540 Compare September 16, 2024 14:00
process.env.FUSION_CLI_ENV = fusionEnv;

const requestService = await fetch(
`https://discovery.ci.fusion-dev.net/service-registry/environments/${fusionEnv}/services/apps`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

use as doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding a todo for now. we need to get it out as alpha and it works. can fix it before beta release.

Copy link
Collaborator

@odinr odinr left a comment

Choose a reason for hiding this comment

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

fix url to disco 🕺

@asbjornhaland
Copy link
Contributor

missing changeset.

@eikeland
Copy link
Contributor Author

missing changeset.

Its not a release towards main.

Comment on lines +29 to +55
if (requestBundle.status === 401 || requestBundle.status === 403) {
throw new Error(
`This is not allowed for this role on this app. HTTP message: ${requestBundle.statusText}`,
);
}

if (requestBundle.status === 404) {
throw new Error(`This app do not exist. HTTP message: ${requestBundle.statusText}`);
}

if (requestBundle.status === 409) {
throw new Error(
`This version is already published. HTTP message: ${requestBundle.statusText}`,
);
}

if (requestBundle.status === 410) {
throw new Error(`This app is deleted. HTTP message: ${requestBundle.statusText}`);
}

if (!requestBundle.ok) {
throw new Error(
`Failed to publish bundle. HTTP status ${requestBundle.status}, ${requestBundle.statusText}`,
);
}

return await requestBundle.json();
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider switch statement instead.

@eikeland eikeland merged commit 17c4eed into feat/cli/appmanager/publish Sep 17, 2024
8 checks passed
@eikeland eikeland deleted the feat/cli/appmanager/refractoring-commands branch September 17, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 💾 CLI fusion framework CLI 👨🏻‍🍳 cookbooks 📚 documentation Improvements or additions to documentation 🚀 feature New feature or request 🧬 Modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants