Skip to content

feat(ui): allow user to customize PR title - #6123

Merged
markphelps merged 5 commits into
flipt-io:v2from
jgaul3:custom-title
Jul 8, 2026
Merged

feat(ui): allow user to customize PR title#6123
markphelps merged 5 commits into
flipt-io:v2from
jgaul3:custom-title

Conversation

@jgaul3

@jgaul3 jgaul3 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Might be nice to let the user change the title of the resulting PR when they spin off their changes. Fully renders the template on the backend with proper branch names.

Screenshot

image

@jgaul3
jgaul3 requested a review from a team as a code owner July 2, 2026 08:54
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 2, 2026

@github-actions github-actions Bot left a comment

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.

Verdict: request changes

The PR correctly moves proposal template rendering to the backend so the UI can pre-fill editable defaults, which is a solid UX improvement. However, the prior review’s blocking concern is still unaddressed: Propose unconditionally renders templates and hard-fails on rendering errors even when the caller supplied a custom title and body that would discard the rendered result, regressing from the previous behavior.

internal/coss/storage/environments/git/store.go

  • major (L146): Propose unconditionally calls renderProposalDefaults and returns its error before checking opts.Title/opts.Body. Previously, supplying custom values skipped template execution entirely, so a broken or unreadable repository-level template did not block proposals. Now it does. Only render defaults when the caller hasn’t provided a value, or make template failure non-fatal when overrides are present.

🤖 Automated review by the Flipt PR review agent.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.26%. Comparing base (a3e5c1c) to head (4de80aa).
⚠️ Report is 1 commits behind head on v2.

Files with missing lines Patch % Lines
internal/coss/storage/environments/git/store.go 0.00% 40 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v2    #6123      +/-   ##
==========================================
- Coverage   62.28%   62.26%   -0.02%     
==========================================
  Files         143      143              
  Lines       14729    14733       +4     
==========================================
  Hits         9174     9174              
- Misses       4809     4813       +4     
  Partials      746      746              
Flag Coverage Δ
integrationtests 33.66% <0.00%> (-0.01%) ⬇️
unittests 53.68% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@markphelps markphelps left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

great idea @jgaul3 ! I think we need to reconcile this (and document) how proposal templates fit in though


const [proposeEnvironment] = useProposeEnvironmentMutation();

const defaultTitle = `Flipt: Update features ${

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

how does this work with the (not well documented at all) feature of templates?

# proposal_title: "Flipt: Update features on {{.Base.Ref}}"
seems like it would always override?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, that is just a flat oversight on my part, I thought the default we were working with was the one on the backend. How about I put in a new api endpoint to get the proposal title value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm inclined to put the proposal title value on ListBranchedEnvironmentChangesResponse but could do it separately as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We have a GetInfo API that already has access to the Config object where templates are populated. And it returns a marshalled Flipt type where we could populate the template object onto. I believe the info value is already accessibile in the UI because we use it for things like theme

@jgaul3 jgaul3 Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@markphelps Thanks for the feedback! The GetInfo API is much easier to use. A couple tradeoffs, it currently just shows the template. We could get the values to populate it in the frontend but the code to do the populating got pretty unpleasant. Or we could populate those branch / environment values in the backend, but I'm not sure I could see a way to do so via the GetInfo endpoint... Please let me know what you think of this crack at a solution and I'll adjust as needed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah i see what you mean. ill add an API to get the rendered template from the backend so it can just be used by the frontend directly. will put up a pr today that we can rebase this one onto

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So I just pushed a follow-up commit onto your branch (kept your commit as-is) that renders the proposal title/body on the backend from the hydrated templates and returns them via ListBranchedEnvironmentChanges, so the modal pre-fills the real, rendered default that the user can override.

The UI already called this to get the commits so no extra roundtrips

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you so much 🙏

@erka erka added the v2 Flipt v2 label Jul 3, 2026
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 7, 2026
Signed-off-by: Jon Gaul <jgaul3@gmail.com>
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 7, 2026
Render the merge-proposal title and body on the backend from the hydrated
templates (built-in defaults overlaid with server- and repository-level
overrides) and return them via ListBranchedEnvironmentChanges so the UI can
pre-fill the form. Users may override the rendered defaults; caller-supplied
values continue to be used verbatim.

This replaces exposing the raw, unrendered server template through /meta/info,
which could not reflect real branch refs or repo-level overrides and led to
unrendered template syntax appearing in proposal titles.

Also fixes a pre-existing Input.tsx ref type error surfaced by the UI build.

Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 7, 2026
markphelps and others added 2 commits July 7, 2026 20:24
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
@markphelps

Copy link
Copy Markdown
Collaborator

@erka do you mind reviewing since I contributed to this branch?

@markphelps
markphelps requested a review from erka July 8, 2026 19:18
Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>

@erka erka left a comment

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.

nice one.

I bumped buf to 1.71 to match mise.

@markphelps
markphelps enabled auto-merge (squash) July 8, 2026 20:24
@markphelps
markphelps merged commit e4d1013 into flipt-io:v2 Jul 8, 2026
29 of 31 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Flipt V2 Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files. v2 Flipt v2

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants