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

PR on Start Work operation in Home view (#3621) #3698

Merged
merged 17 commits into from
Nov 12, 2024
Merged

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Oct 25, 2024

Description

This PR introduces initial Start Work flow that:

  • adds a "Start Work" shortcut to the home view
  • lets user to select a GitHub issue and then starts a create-branch flow
  • suggests the repository of the selected issue as default repository for creating a branch
  • suggests a default branch name based on issue title

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@sergeibbb sergeibbb self-assigned this Oct 25, 2024
@gitkraken gitkraken deleted a comment Oct 28, 2024
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

Mostly nitpicks - the only major suggestion would be to set up a provider that manages the issue querying and includes caching and error handling as we have with Launchpad. Most of this would be for future-proofing purposes - we don't automatically query for issues with this feature like we do for Launchpad - but the need for that may arise sooner than we think (for example - some UX on the Home view showing a count of how many issues we have, etc.)

src/commands/git/branch.ts Outdated Show resolved Hide resolved
0,
0,
createDirectiveQuickPickItem(Directive.Noop, undefined, {
label: 'Start work lets you quickly create a branch and initial code for a selected issue',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick, but we might want to mention worktrees in here somehow since this flow will, most likely, at least heavily encourage creating one.

@@ -776,7 +776,7 @@ export class GitProviderService implements Disposable {
return { allowed: subscription.account?.verified !== false, subscription: { current: subscription } };
}

if (feature === 'launchpad') {
if (feature === 'launchpad' || feature === 'startWork') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to follow up with @justinrobots if you haven't already since I think there was some confusion on whether this gating applies to "Start Work" the same way it does for Launchpad.

};

export const StartWorkQuickInputButton: QuickInputButton = {
iconPath: new ThemeIcon('beaker'),
Copy link
Contributor

Choose a reason for hiding this comment

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

I put the 'beaker' icon as a placeholder in my WIP, but we should probably check in with the team on what would make a good representative icon for this feature in general, as well as for actions like this.

async function updateContextItems(container: Container, context: Context) {
context.result = {
items:
(await container.integrations.getMyIssues([HostingIntegrationId.GitHub]))?.map(i => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we can do one of the following:

  1. Create a startWorkProvider
  2. Rename the launchpadProvider to be a bit more flexible outside the domain of Launchpad itself and extend it

And then we can add functions to the provider to:

  1. Get searched issues, with caching and error handling like we do for Launchpad items, and the ability to filter out stale ones and other post-processing like we do with PRs for Launchpad (not that we have to implement any post-processing now, just the caching and error handling parts)
  2. Complete actions on "start work" items, like creating a branch, etc.
  3. Set up other utilities that we want in the future for Start Work so that the command file doesn't get out of hand.
  4. Use those functions here as needed, like launchpad does with launchpadProvider.

@sergeibbb sergeibbb linked an issue Nov 5, 2024 that may be closed by this pull request
@sergeibbb sergeibbb force-pushed the feature/3621-start-work branch 9 times, most recently from 51622b8 to 937b1cc Compare November 8, 2024 19:22
@sergeibbb
Copy link
Member Author

sergeibbb commented Nov 8, 2024

@axosoft-ramint @eamodio

Please review it one more time. All notes related to implementing a provider haven't been fixed yet, because I've been focusing on the functionality and Eric has suggested to implement optimizations as a follow-up.

So, now you're welcome to suggest any urgent fixes that I can make on Monday.

@ericf-axosoft
Copy link
Contributor

@axosoft-ramint @ericf-axosoft

Please review it one more time. All notes related to implementing a provider haven't been fixed yet, because I've been focusing on the functionality and Eric has suggested to implement optimizations as a follow-up.

So, now you're welcome to suggest any urgent fixes that I can make on Monday.

@sergeibbb I assume you mean @eamodio instead of me, right?

@sergeibbb
Copy link
Member Author

@ericf-axosoft

I assume you mean @eamodio instead of me, right?

True. Sorry for bothering

@sergeibbb
Copy link
Member Author

sergeibbb commented Nov 12, 2024

@axosoft-ramint

  1. (in the pre-release, if I click the globe to open a Launchpad PR in the browser, the quickpick stays open).

disappears for me in pre-releas. It disappears every time when the window looses the focus, but it stays if (and after) the quickpick has a text in the search field.

quickpick-disappears.mp4

But I agree that Start Work is different from Launchpad. After typing something in the search field and clicking the globe: Launchpad stays, but Start Work disappears. I'm going to fix it.

chivorotkiv and others added 2 commits November 12, 2024 19:16
If user chooses to create a branch without an issue it doesn't require connection.
(#3621, #3698)
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

Some of the issues from previous review may be due to debugging or pre-existing regressions. We will address those and any other unaddressed issues above post-merge.

@sergeibbb sergeibbb merged commit 75e560f into main Nov 12, 2024
3 checks passed
sergeibbb pushed a commit that referenced this pull request Nov 12, 2024
sergeibbb added a commit that referenced this pull request Nov 12, 2024
sergeibbb added a commit that referenced this pull request Nov 12, 2024
sergeibbb added a commit that referenced this pull request Nov 12, 2024
It has been broken by adding 'slug' dependency that pulled to the test assembly through Container, so we need to uncouple.
(#3621, #3698)
sergeibbb added a commit that referenced this pull request Nov 12, 2024
sergeibbb added a commit that referenced this pull request Nov 12, 2024
just to create a branch or start working on an issue
(#3621, #3698)
sergeibbb added a commit that referenced this pull request Nov 12, 2024
sergeibbb pushed a commit that referenced this pull request Nov 12, 2024
sergeibbb pushed a commit that referenced this pull request Nov 12, 2024
If user chooses to create a branch without an issue it doesn't require connection.
(#3621, #3698)
@sergeibbb sergeibbb deleted the feature/3621-start-work branch November 13, 2024 13:12
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.

Start Work operation in Home view
4 participants