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

Add support for rich code navigation in GitHub #12855

Merged
merged 7 commits into from
Apr 14, 2022
Merged

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Apr 7, 2022

We discussed this with the GitHub folks. It's pretty cool.

(Rich code nav) brings editor-level navigation capabilities into
GitHub.com for C++ and C# repos

If you want to try it out, you can go here: GitHub web
editor

The link is already on the correct branch. If you haven't used
github.dev before there are two steps to get setup:

  1. In the settings file you'll need to enable Rich Code Nav. If you just
    search for "rich", there'll be a checkbox to enable it.
  2. Refresh the page and you should see a stacked papers icon in the task
    bar at the bottom. Click on that and select "Latest Index". Then one
    more refresh and you should be good to go with navigation in both C#
    and C++ files!

@@ -11,6 +11,7 @@ jobs:
BuildConfiguration: ${{ parameters.configuration }}
BuildPlatform: ${{ parameters.platform }}
WindowsTerminalBranding: ${{ parameters.branding }}
EnableRichCodeNavigation: true
Copy link
Member

Choose a reason for hiding this comment

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

I don't see anything using this variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

apparently it's magic to turn it on in the code nav tooling itself.

Copy link

Choose a reason for hiding this comment

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

Yes, we use this parameter to tell us to run a specific package called RichCodeNav.EnvVarDump, which is needed for some builds so we can get information about the environment the build is running in.

jobs:
- job: CodeNavIndexer
displayName: Run Github CodeNav Indexer
pool: { vmImage: windows-2019 }
Copy link
Member

Choose a reason for hiding this comment

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

Does it have to run on Windows? Windows is much slower than Linux at starting up here.

I mean it's fine, but just curious.

Copy link

Choose a reason for hiding this comment

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

Unfortunately right now we do have to run on Windows, but we're working on Linux support! We'll send out a mail once we have that ready so you can switch over!

Comment on lines +99 to +104
- stage: CodeIndexer
displayName: Github CodeNav Indexer
dependsOn: [Build_x64]
condition: succeeded()
jobs:
- template: ./templates/codenav-indexer.yml
Copy link
Member

Choose a reason for hiding this comment

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

Oof. Doesn't this mean it's going to run on every push and every rolling build? Won't that end up taking a massive amount of storage space for all those indexes to be saved? I would think we would run it only on main or something.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is a good question. Lemme bring in the codenav folks to see what they think

Copy link

Choose a reason for hiding this comment

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

Hi! Holly from the codenav team here! We're fine with this running with such high frequency and the storage load, we actually want to test how well we scale to highly active repos. I will say, most folks who onboard do only run our task on builds of main and a few teams have made a separate .yml file just for the build+codenav tasks so that they can have more fine-tuned control of when it runs, but it's up to you what builds you would find benefit from having navigation on.

Copy link
Member

Choose a reason for hiding this comment

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

My bigger concern is that this will build against 3p code on pull requests. We might want to restrict it like we did the ARM64 build 😄

Comment on lines +99 to +104
- stage: CodeIndexer
displayName: Github CodeNav Indexer
dependsOn: [Build_x64]
condition: succeeded()
jobs:
- template: ./templates/codenav-indexer.yml
Copy link
Member

Choose a reason for hiding this comment

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

My bigger concern is that this will build against 3p code on pull requests. We might want to restrict it like we did the ARM64 build 😄

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 13, 2022
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 14, 2022
@zadjii-msft
Copy link
Member Author

@DHowett I think that's fixed in fe8e173

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

b o o m

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Apr 14, 2022
@ghost
Copy link

ghost commented Apr 14, 2022

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@DHowett DHowett merged commit 23ff072 into main Apr 14, 2022
@DHowett DHowett deleted the dev/migrie/ci/gh-codenav branch April 14, 2022 20:46
DHowett added a commit that referenced this pull request Apr 15, 2022
@DHowett DHowett restored the dev/migrie/ci/gh-codenav branch April 15, 2022 01:56
DHowett added a commit that referenced this pull request Apr 15, 2022
DHowett pushed a commit that referenced this pull request Apr 18, 2022
This is exactly the same as #12855, save for one small difference:

```diff
diff --git a/build/pipelines/ci.yml b/build/pipelines/ci.yml
index e4e53e9b2..dc9040aeb 100644
--- a/build/pipelines/ci.yml
+++ b/build/pipelines/ci.yml
@@ -99,7 +99,6 @@ stages:
   - stage: CodeIndexer
     displayName: Github CodeNav Indexer
     dependsOn: [Build_x64]
-    condition: succeeded()
+    condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')))
     jobs:
       - template: ./templates/codenav-indexer.yml
-    condition: not(eq(variables['Build.Reason'], 'PullRequest'))

```

Because the first ones failed with an error about a duplicate condition
And that hosed the whole CI
@ghost
Copy link

ghost commented May 24, 2022

🎉Windows Terminal Preview v1.14.143 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants