Skip to content

About

Follow-along Java sample for the Sonar Vortex semantic navigation for developers and coding agents blueprint.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Sonar Vortex semantic navigation sample: GCToolKit

This repository is the follow-along sample for the blueprint "Sonar Vortex semantic navigation for developers and coding agents". The blueprint is the primary learning resource. It explains each step and shows the expected output of every command. This repository gives you the code to run them against.

The code is a fork of Microsoft's GCToolKit, a Java library that parses HotSpot garbage collection logs: a multi-module Maven project with 312 Java source files. It is large enough that tracing callers and implementations with text search gets tedious, which makes it a good target for semantic navigation. The upstream README is kept as README-gctoolkit.md, and the upstream MIT license and notices are unchanged.

What is in this repository

  • main is the exact code the blueprint analyzes. Every *.java file is identical to the upstream snapshot used in the blueprint run, so the navigation output you get matches the blueprint.
  • .github/workflows/build.yml is a "Build and Analyze" GitHub Actions workflow. It builds with the Maven wrapper (JDK 21) and runs the SonarQube Cloud scanner. It needs one repository secret, SONAR_TOKEN.
  • The root pom.xml sets no SonarQube organization or project key. The workflow passes both on the command line.
  • There is no .sonar-config.json. You create it with sonar link in the blueprint.

The project has no dependencies beyond what upstream GCToolKit already uses. Nothing was added for this sample.

Get your own copy and bind it to SonarQube Cloud

  1. Select Use this template to create your own copy (the repository is a template). The workflow derives the SonarQube Cloud organization from your GitHub owner and the project key from <owner>_<repository name>, which is the default key SonarQube Cloud assigns when you import a GitHub repository.
  2. In SonarQube Cloud, import your new repository as a project. If your SonarQube Cloud organization key differs from your GitHub owner, or you chose a different project key, edit the two -Dsonar.* lines in .github/workflows/build.yml to match.
  3. Add a repository secret named SONAR_TOKEN with a SonarQube Cloud user token.
  4. Run the Build and Analyze workflow (it also runs on every push to main). Wait for it to finish so the project has an analysis on main.
  5. Clone your copy and follow the blueprint. Link the clone to your project with sonar link (it writes .sonar-config.json), then run the sonar context navigation commands the blueprint walks through.

Build locally

./mvnw -B -DskipTests package

The build needs JDK 21 or later and network access to Maven Central and GitHub, because the gclogs module downloads the upstream test data.

License

Upstream GCToolKit is released under the MIT license. See LICENSE and NOTICES.md.

About

Follow-along Java sample for the Sonar Vortex semantic navigation for developers and coding agents blueprint.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages