Skip to content

feat: default to manifest.json over get-manifest hook - #629

Open
srtaalej wants to merge 7 commits into
mainfrom
ale-add-force-to-run
Open

feat: default to manifest.json over get-manifest hook#629
srtaalej wants to merge 7 commits into
mainfrom
ale-add-force-to-run

Conversation

@srtaalej

@srtaalej srtaalej commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • GetManifestLocal now prefers reading manifest.json directly from the project root, falling back to the get-manifest hook only when the file doesn't exist
  • WriteManifestLocal creates manifest.json when it doesn't exist instead of returning a warning, ensuring manifest sync always persists results locally

Closes #627

Context

Projects relying on a get-manifest hook instead of a static manifest.json hit:

! No manifest.json found in project root — merged manifest was not written locally

This makes manifest.json the preferred source of truth for local manifests while maintaining backward compatibility — the hook is still invoked for projects that don't have a manifest.json.

Test plan

  • make test passes
  • Existing tests updated to verify new file-first behavior
  • Manual test: project with manifest.json reads file directly (hook not invoked)
  • Manual test: project without manifest.json falls back to get-manifest hook
  • Manual test: slack manifest sync creates manifest.json when it doesn't exist

@srtaalej
srtaalej requested a review from a team as a code owner August 10, 2026 17:10
@srtaalej srtaalej self-assigned this Aug 10, 2026
@srtaalej srtaalej added enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment labels Aug 10, 2026
@srtaalej srtaalej changed the title feat: add --manifest-source flag to run and deploy commands feat: default to manifest.json over get-manifest hook Aug 10, 2026
@srtaalej srtaalej added this to the Next Release milestone Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.21%. Comparing base (b2ad402) to head (da81af0).

Files with missing lines Patch % Lines
internal/manifest/writeback.go 33.33% 2 Missing and 2 partials ⚠️
internal/app/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #629      +/-   ##
==========================================
- Coverage   72.24%   72.21%   -0.04%     
==========================================
  Files         238      238              
  Lines       20072    20093      +21     
==========================================
+ Hits        14502    14511       +9     
- Misses       4299     4307       +8     
- Partials     1271     1275       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@srtaalej srtaalej closed this Aug 10, 2026
@srtaalej srtaalej reopened this Aug 10, 2026
@srtaalej srtaalej closed this Aug 10, 2026
@srtaalej
srtaalej deleted the ale-add-force-to-run branch August 10, 2026 17:41
@srtaalej
srtaalej restored the ale-add-force-to-run branch August 10, 2026 17:41
@srtaalej srtaalej reopened this Aug 10, 2026

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@srtaalej Super appreciate the changes toward this 🌟

I left a comment on precedence of manifestations and am thinking that the fallback manifest.json file allows us to consider the manifest "CLI-managed" while with a hook ought mean not.

This pattern has a slow rollout with hooks needing to be updated too, but I'm most optimistic for the changes it'll unlock with confidence in changing a project manifest.

Comment thread internal/app/manifest.go Outdated
Comment on lines +82 to +85
if exists, _ := afero.Exists(c.fs, manifestPath); exists {
return c.readManifestFile(manifestPath)
}
return c.getManifestFromHook(ctx, sdkConfig, hookExecutor)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔭 thought: We should reverse this order to check if a get-manifest hook exists and fallback to reading "manifest.json" file. Deprecating the hook might happen at the hook package while the CLI continues to support it.

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔍 Before testing more I want to cut scope on this change. I think other PRs can follow to ensure we're not clobbering an SDK managed manifest!

Comment on lines 47 to 56
if !exists {
return WriteBackResult{
Warning: fmt.Sprintf("No %s found in project root — merged manifest was not written locally", manifestFileName),
}, nil
fresh, err := marshalFresh(manifest)
if err != nil {
return WriteBackResult{}, fmt.Errorf("failed to serialize merged manifest: %w", err)
}
if err := atomicWriteFile(fs, manifestPath, fresh, 0644); err != nil {
return WriteBackResult{}, fmt.Errorf("failed to write %s: %w", manifestFileName, err)
}
return WriteBackResult{Written: true, FilePath: manifestPath}, nil
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🦠 suggestion: Let's keep this change for a separate PR!

Comment thread internal/app/manifest.go
return c.readManifestFile(manifestPath)
}

func (c *ManifestClient) readManifestFile(path string) (types.SlackYaml, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
func (c *ManifestClient) readManifestFile(path string) (types.SlackYaml, error) {
func (c *ManifestClient) getManifestFromFile(sdkConfig hooks.SDKCLIConfig) (types.SlackYaml, error) {

🌵 thought: I think we should match the function name convention here and also keep path specific logic contained within this function. I'm less confident of the second thought FWIW!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default to manifest.json over get-manifest hook in SDK templates

2 participants