Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make it so we can see different content based on the currently selected branch

See original GitHub issue

screenshot 2018-12-07 at 11 39 51

The hub already supports a ?branch= query parameter and there is a chance that it already works (although in a quick test it didn’t work on one of our test applications). This issue covers making sure that the query param works and implementing the branch picker that is hooked into that query param.

The branch query param is a special case where it doesn’t need a prefix like other queryParams in the new hub routing system i.e. https://<application domain>/blogs/chris?branch=patch-01 should make the hub display the contents from branch named patch-01


  • Add the branch-picker dropdown back into the tools
  • allow the branch-picker to be able to see all current branches
  • make it so that when the branch-picker changes it changes the ?branch= query param
  • Make sure the data service includes the branch query param in the JSON:API query
  • Make sure the searcher (or maybe jsonapi middleware) is passed the branch from the right place in the query params
  • Make sure the right data is passed back to the end user seeing as the searcher should be doing most of the heavy lifting
    • This is probably all already implemented, we just need to essentially write glue code and ensure that things are working as expected

Open questions

  • Is it possible to have certain query params always available in the new routing implementation? i.e. params are provided by the hub package and therefore are always available to any Cardstack application - Answer: branch is a special case 👍

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

habdelracommented, Dec 12, 2018

but yeah, based on our conversation during the planning meeting, Ember Data is gonna probably gonna cache stuff incorrectly. We’ll need to introduce a serializer to prepend the branch name to the record id in Ember Data, and unwind that for communication back to the server. Also we should make sure our data service is aware of this convention too. We will need to likely need to do something similar for the model name as well for schema that is different in the different branches, but let’s do this in “baby steps” and tackle that separately as that is likely an order of magnitude more challenging to address.

For the spaces model itself, i think that is hovering at a realm above branches and is capable of loading cards for the branch that the client requests interest in. (so likely the serializer should skip trying to incorporate the branch name in the spaces’ model id).

although, the spaces model will need to point to a branch specific primary card–so probably the spaces record’s id does need to be prepended with the branch name.

I still love this image, regardless:


mansonacommented, Jan 31, 2019

@marcoow yes 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I see the differences between two branches?
Determining which files have changed with git diff --name-status master..branchName is markedly different than seeing the exact differences ...
Read more >
Manage Git branches | IntelliJ IDEA Documentation - JetBrains
In the dialog that opens, specify the branch name, and make sure the Checkout branch option is selected if you want to switch...
Read more >
Managing branches - GitHub Docs
At the top of the app, click Current Branch and then in the list of branches, click the branch that you want to...
Read more >
Use branches in workflows - Knowledge Base - HubSpot
Learn how to use if/then and value equals branches in workflows to direct enrolled records down multiple paths based on set conditions.
Read more >
Protected branches - GitLab Docs
Create a protected branch · On the top bar, select Main menu > Projects and find your project. · On the left sidebar,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found