Skip to content

Fix plugin version not showing in System Console#204

Merged
nang2049 merged 2 commits intomasterfrom
fix-plugin-version-display
Apr 16, 2026
Merged

Fix plugin version not showing in System Console#204
nang2049 merged 2 commits intomasterfrom
fix-plugin-version-display

Conversation

@nevyangelova
Copy link
Copy Markdown
Contributor

@nevyangelova nevyangelova commented Apr 13, 2026

Summary

The plugin version was not displaying in the System Console after installation. The root cause was that the bundle Makefile target copied the raw plugin.json (which intentionally omits the version field) into the dist archive, instead of using the manifest build tool to write a version-injected plugin.json.

  • Add dist command to build/manifest/main.go to write the enriched manifest (with version derived from git tags and auto-generated release notes URL) to the dist directory
  • Update Makefile bundle target to use ./build/bin/manifest dist instead of cp $(MANIFEST_FILE)
  • Add homepage_url and support_url to plugin.json for release notes URL generation

Ticket Link

https://mattermost.atlassian.net/browse/MM-68234

Change Impact: 🟡 Medium

Reasoning: The change replaces a simple manifest file copy in the build pipeline with a new manifest CLI dist command that writes an enriched manifest (including version derived from git tags and generated release_notes_url) into the dist directory. This is isolated to the build/bundle process and runtime code is unaffected, but it introduces a new build-time dependency and a failure mode if the manifest tool fails.

Regression Risk: Moderate. The Makefile now depends on ./build/bin/manifest dist succeeding; while the new command ensures the dist directory is created before writing (reducing a prior failure mode), there are no evident unit tests for the new dist path and the Makefile has no explicit fallback if the tool fails. The change does not touch authentication, data persistence, or public runtime APIs.

QA Recommendation: Perform manual QA: (1) run make bundle to ensure the build completes, (2) verify dist/<plugin-id>/plugin.json contains the injected version, homepage_url, support_url, and release_notes_url, and (3) install the resulting plugin and confirm the version appears in the System Console. Skipping manual QA is not recommended given the build pipeline dependency.
Generated by CodeRabbitAI

The bundle target was copying the raw plugin.json (which has no version
field) into the dist archive instead of using the manifest tool to write
a version-injected plugin.json. This caused the System Console to show
no version number after installing the plugin.

- Add dist command to build/manifest/main.go to write the enriched
  manifest (with version and release_notes_url) to the dist directory
- Update Makefile bundle target to use ./build/bin/manifest dist
- Add homepage_url and support_url to plugin.json for release notes
  URL generation

Made-with: Cursor
@nevyangelova nevyangelova requested a review from a team as a code owner April 13, 2026 13:19
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

Makefile's bundle target now calls the manifest tool (./build/bin/manifest dist) instead of copying the manifest file. The manifest tool gained a "dist" command that writes a resolved manifest to dist/<id>/plugin.json and auto-populates ReleaseNotesURL when applicable. plugin.json adds homepage_url and support_url fields.

Changes

Cohort / File(s) Summary
Build / Bundle
Makefile
Replaced direct copy of $(MANIFEST_FILE) into dist/... with invocation of ./build/bin/manifest dist in the bundle target.
Manifest tool
build/manifest/main.go
Added dist command to serialize the resolved manifest to dist/<manifest.Id>/plugin.json; findManifest() now fills ReleaseNotesURL when empty and BuildTagLatest + HomepageURL are set; error handling improved.
Plugin metadata
plugin.json
Added top-level homepage_url and support_url fields pointing to the plugin repo and issues page.

Sequence Diagram(s)

sequenceDiagram
  participant Makefile as Makefile (invoker)
  participant Manifest as manifest binary
  participant FS as Filesystem (dist/)
  Makefile->>Manifest: run "./build/bin/manifest dist"
  Manifest->>Manifest: load/resolve manifest, compute ReleaseNotesURL if needed
  Manifest->>FS: mkdir -p dist/<manifest.Id> && write plugin.json
  FS-->>Makefile: dist/<id>/plugin.json available
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • avasconcelos114
  • Rajat-Dabade

Poem

🐰
I hopped through Make and called my tool,
Manifest baked, not copied like a fool.
Release notes found a proper home,
Homepage and support now brightly shown,
Dist fluffed up — bundle bounds for the loam.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the PR's primary objective: fixing the plugin version not displaying in the System Console by replacing the raw manifest copy with an enriched one.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-plugin-version-display

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build/manifest/main.go`:
- Around line 196-203: The distManifest function currently writes to
"dist/<id>/plugin.json" without ensuring the parent directory exists; update
distManifest to compute the output directory for manifest.Id (e.g.,
"dist/<id>"), call os.MkdirAll on that directory with a safe mode (e.g., 0755)
before writing, and use filepath.Join to build the final file path
("<dir>/plugin.json") so os.WriteFile won't fail when the directory is missing;
ensure errors from MkdirAll are returned/wrapped similarly to the existing error
handling.
- Around line 142-147: The release-notes URL is being built with BuildTagLatest
regardless of the manifest's derived version, which can point to the wrong tag;
change the logic that sets manifest.ReleaseNotesURL (the block using
url.JoinPath and BuildTagLatest) to prefer manifest.Version (which is derived
from BuildTagCurrent) as the tag to append, falling back to BuildTagLatest only
if manifest.Version is empty, then call url.JoinPath(manifest.HomepageURL,
"releases", "tag", tag) and handle the error as before.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b12935b6-080c-4ab9-b620-37a998507616

📥 Commits

Reviewing files that changed from the base of the PR and between 04a6cd7 and 3bff2ff.

📒 Files selected for processing (3)
  • Makefile
  • build/manifest/main.go
  • plugin.json

Comment thread build/manifest/main.go
Comment thread build/manifest/main.go
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
build/manifest/main.go (1)

142-147: ⚠️ Potential issue | 🟠 Major

Release notes URL can point to a different version than the resolved manifest.

manifest.Version is resolved from current tags first (Line 118-140), but Line 143 always uses BuildTagLatest. Building a non-latest tag can generate a mismatched release URL.

💡 Proposed fix
-	if manifest.ReleaseNotesURL == "" && BuildTagLatest != "" && manifest.HomepageURL != "" {
-		manifest.ReleaseNotesURL, err = url.JoinPath(manifest.HomepageURL, "releases", "tag", BuildTagLatest)
+	releaseTag := BuildTagLatest
+	if manifest.Version != "" {
+		releaseTag = "v" + strings.SplitN(manifest.Version, "+", 2)[0]
+	}
+
+	if manifest.ReleaseNotesURL == "" && releaseTag != "" && manifest.HomepageURL != "" {
+		manifest.ReleaseNotesURL, err = url.JoinPath(manifest.HomepageURL, "releases", "tag", releaseTag)
 		if err != nil {
 			return nil, errors.Wrap(err, "failed to generate release notes URL")
 		}
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@build/manifest/main.go` around lines 142 - 147, The release notes URL
construction currently uses BuildTagLatest which can mismatch the resolved
manifest.Version; change the logic in the block that sets
manifest.ReleaseNotesURL (the url.JoinPath call) to use manifest.Version (or
fall back to BuildTagLatest only if manifest.Version is empty) so the generated
URL matches the resolved manifest version, and ensure the condition still checks
manifest.HomepageURL and that url.JoinPath error handling remains the same.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@build/manifest/main.go`:
- Around line 142-147: The release notes URL construction currently uses
BuildTagLatest which can mismatch the resolved manifest.Version; change the
logic in the block that sets manifest.ReleaseNotesURL (the url.JoinPath call) to
use manifest.Version (or fall back to BuildTagLatest only if manifest.Version is
empty) so the generated URL matches the resolved manifest version, and ensure
the condition still checks manifest.HomepageURL and that url.JoinPath error
handling remains the same.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 84a19de3-ac10-46b9-b582-7969ecdb1eb9

📥 Commits

Reviewing files that changed from the base of the PR and between 3bff2ff and 7613abd.

📒 Files selected for processing (1)
  • build/manifest/main.go

Copy link
Copy Markdown

@avasconcelos114 avasconcelos114 left a comment

Choose a reason for hiding this comment

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

LGTM!

@nang2049 nang2049 requested a review from ogi-m April 15, 2026 12:31
@nang2049
Copy link
Copy Markdown

@coderabbitai review

Copy link
Copy Markdown

@ogi-m ogi-m left a comment

Choose a reason for hiding this comment

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

LGTM!

@nang2049
Copy link
Copy Markdown

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nang2049
Copy link
Copy Markdown

@coderabbitai approve

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

✅ Actions performed

Comments resolved and changes approved.

@nang2049 nang2049 merged commit b9d05ff into master Apr 16, 2026
9 checks passed
@nang2049 nang2049 deleted the fix-plugin-version-display branch April 16, 2026 13:25
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.

4 participants