Code

Overview

If you're using Flat with a software team, Flat has a powerful integration with GitHub to automatically link pull requests with topics.

When a pull request is linked to a topic, you'll get several benefits to streamline your team's collaboration:

  • Real-time PR status: Open PRs are displayed right in the workspace on the topic's card, including their title, live build status, deploy preview and other CI/CD links, review requests, merge conflict status, and more, making it easy for you and your team to stay on top of development activity and jump in when a PR needs attention.

  • Easier, more timely code reviews: Flat helps teams stay on top of code reviews by displaying pending reviews right in the workspace on the topic's card, as well as in the reviewer's threads view. Also, Flat posts a comment on the PR in GitHub with the topic's details. That makes it easier for code reviewers to know what a PR is for without having to navigate back to Flat.

  • Knowledge retention: Merged PRs are permanently retained in the linked topic's details. Not sure how a topic was implemented? Open the topic in Flat and the PRs are all right there. Not sure why some old code was written? Open the PR in GitHub and follow the link left by Flat to get back to the topic.

Learn more about the GitHub integration: GitHub

Step-by-step

Enabling or disabling the Code section for topics in a workspace

To show the Code section for topics in a workspace, first install Flat's GitHub integration. The Code section will then be enabled for all existing workspaces.

Learn more about configuring workspace options: Managing workspaces.

Linking a pull request to a topic

Copy/paste Flat's suggested branch name

Flat generates a suggested branch name for each topic that you can quickly copy/paste. To grab the suggested branch name:

  • While on the topic's page: Scroll down to the Code section and click the copy button next to the suggested branch name.

  • While in the workspace: Hover over the topic's card, click the ellipsis menu, and choose Copy branch name.

Use your own branch name

You can use your own branch name as long as it contains the topic's ID in a recognizable way. For example, for topic ID #123, the branch name could use these patterns:

  • 123

  • 123-foo-bar

  • 123_foo_bar

  • baz/123-foo-bar

Topic IDs aren't shown by default, but you can choose to show them by visiting Personal Settings | Appearance.

Flat doesn't support linking code to topics if you push commits directly to your trunk branch. You must first push the commits to a separate branch with a name containing the topic's ID, then open a pull request from that branch to your trunk branch.

To view the pull requests associated with a topic, visit the topic's page and scroll down to the Code section. You'll see both open and merged pull requests linked to the topic. Click any pull request to open it in GitHub.

In addition, when you view a workspace, open pull requests are shown on the associated topic's card, giving you and your team better visibility and quicker access.

When Flat links a pull request to a topic, it posts a comment on the pull request in GitHub with the topic's title, description, and other details, along with a link back to the topic in Flat. This makes it easy for code reviewers to know the context of the pull request without having to open the topic, and makes it easy for anyone to navigate to the topic if they need to.

Last updated