equinor / equinor/fusion-framework

Support --snapshot when publishing an existing app bundle

Open
#4,315 0 comments 0 reactions 0 assignees View on GitHub
✨ improvement 💾 CLI
Dominant language
TypeScript
Stars
10
Forks
10
Avg merge
19h 40m
Merged PRs (30d)
150

Description

## Is your feature request related to a problem? Please describe.

`@equinor/fusion-framework-cli` documents `--snapshot` support for `ffc app pack` and `ffc app publish`, but in practice snapshot behavior only helps when the CLI is responsible for building or packing the application.

When `ffc app publish` is given an existing bundle, the publish flow uses bundle metadata from `metadata.json`. There is currently no documented way to provide a caller-controlled snapshot or unique build id for artifact-based publishing without first rebuilding or repacking the artifact.

This makes it hard for shared CI/CD actions such as `equinor/fusion-action-app-publish` to create snapshot versions from an existing artifact without requiring extra client-side build steps.

## Describe the solution you'd like

Add support for applying a snapshot identifier during artifact-based app publishing.

Examples of acceptable behavior:

- `ffc app publish app-bundle.zip --snapshot`
- `ffc app publish app-bundle.zip --snapshot pr-123`

Expected outcome:

- The CLI publishes the artifact with a unique snapshot version without modifying `package.json`.
- The snapshot/version semantics stay aligned with current CLI snapshot behavior for source-based `pack`/`publish`.
- Callers do not need to unzip and rewrite `metadata.json` themselves.

## Describe alternatives you've considered

- Rewriting `metadata.json` in the artifact before calling `ffc app publish`. This works around the limitation, but duplicates CLI logic in consumers and risks drift from upstream versioning rules.
- Forcing every consumer to pack with `--snapshot` before publishing. This works when the consumer controls the build step, but is less useful for shared actions or build-once/deploy-many pipelines.

## Additional context

- CLI docs: `https://github.com/equinor/fusion-framework/blob/main/packages/cli/docs/application.md`
- CLI command docs/code mention snapshot support:
- `https://github.com/equinor/fusion-framework/blob/main/packages/cli/src/cli/commands/app/pack.ts`
- `https://github.com/equinor/fusion-framework/blob/main/packages/cli/src/cli/commands/app/publish.ts`
- Downstream use case: enabling `equinor/fusion-action-app-publish` to support snapshot publishing without forcing every consumer to customize their build pipeline.

Contributor guide

Open the contributing guide

Research direction

Start with packages/cli/src/cli/commands/app/publish.ts and pack.ts, then read packages/cli/docs/application.md to compare the documented and existing snapshot flows. Trace how artifact publishing reads metadata.json and define completion as supporting both --snapshot and --snapshot pr-123 without rewriting package.json or the bundle, while preserving current source-based semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, release
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.