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

[FLI-808] Allow switching branches/refs in UI #2711

Open
1 task done
markphelps opened this issue Jan 27, 2024 · 2 comments
Open
1 task done

[FLI-808] Allow switching branches/refs in UI #2711

markphelps opened this issue Jan 27, 2024 · 2 comments
Labels
enhancement Created by Linear-GitHub Sync lg Little bit big

Comments

@markphelps
Copy link
Collaborator

markphelps commented Jan 27, 2024

Problem

In v1.36 we introduced the ability to evaluate different git references (branches) if using our git backends (guide here).

Also in 1.36 we added the ability to show the current configured branch in the UI (#2672)

It would be great if we could now allow switching between branches in the UI by combing these features.

Ideal Solution

  • Allow the branch in the UI to change to a dropdown on click, allowing the user to pick between the various known references that Flipt knows of
  • Selecting a new reference should reload the UI with all state for the selected ref
  • Since this is using the git backend, it will only need to work for readonly, no writes

297527234-07fce275-fd26-435b-9d3a-3c48d1d1ce58

Search

  • I searched for other open and closed issues before opening this

Additional Context

I started a WIP branch to see how this would work

I think we will need to do the following:

  • Update almost all RTK queries to pass an optional ref parameter either in the query string or body of the request, depending on the API (ie evaluate will use ref in body). Like main...ui-branch-picker#diff-d179bd77db52401511bb679af1e3fbedeb0db93eefe474fae1d9ea92224ca3ceR14-R19
  • Create an internal API to list all of the known refs that Flipt knows about. I believe we get all the references in the Git repo here or around there. We will need to surface these references as an /internal API or similar so that the Flipt UI can populate the dropdown list to pick from

/cc @GeorgeMac for confirmation/clarification

From SyncLinear.com | FLI-808

@markphelps markphelps added lg Little bit big enhancement Created by Linear-GitHub Sync labels Jan 27, 2024
@markphelps markphelps changed the title Allow switching branches/refs in UI [FLI-808] Allow switching branches/refs in UI Jan 27, 2024
@erka
Copy link
Collaborator

erka commented Jan 27, 2024

You could also try to apply ref param in customFetchFn

export const customFetchFn: CustomFetchFn = async (url, options) => {
const headers = defaultHeaders();
const response = await fetch(url, {
...options,
headers
});
checkResponse(response);
return response;
};

@GeorgeMac
Copy link
Contributor

That is pretty spot on, the only change is that it is the full string “reference” instead of “ref”.

@markphelps markphelps mentioned this issue Jan 31, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Created by Linear-GitHub Sync lg Little bit big
Projects
Status: No status
Development

No branches or pull requests

3 participants