Skip to content

Instantly share code, notes, and snippets.

@zedbeit
Created September 9, 2022 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zedbeit/b196d93a2ae4f6d7c8a693017d71c5a6 to your computer and use it in GitHub Desktop.
Save zedbeit/b196d93a2ae4f6d7c8a693017d71c5a6 to your computer and use it in GitHub Desktop.
GSoC 2022 Final Report

Google Summer of Code 2022 Final Report

GSoC logo

Organization: JBoss

Mentors:

  • Max Rydahl Andersen
  • Lukas Krejci

Quarkus - API validation and tracking for Quarkus and Quarkiverse

Project Overview

The project idea is to utilize the already existing revapi setup and enhance it to properly check and generate documentation for api breakages in a way that help users and extension writers.

This will be an important element in Quarkus releases and will be used heavily across all extensions. The revapi integration will have many year impact on ensuring Quarkus development team and users will be able to upgrade and migrate for years to come.

About Quarkus

Quarkus is a Kubernetes-native Java framework tailored for GraalVM and HotSpot, crafted from best-of-breed Java libraries and standards. It was created to enable Java developers to create applications for a modern, cloud-native world.

To learn more about Quarkus visit here

About Revapi

Revapi is a full featured API checker for Java and beyond. It is an API analysis and change tracking tool written in Java.

Its focus is mainly on Java language itself but it has been specifically designed to not be limited to just Java.

To learn more about Revapi visit here


Over the period of the program, I worked on enhancing the current revapi reporting to be useful. It had 3 main tasks:

  1. Make it easy to record/update api-changes.xml file in project for PR
  2. Reduce false positive from revapi output/report
  3. Make output pretty/functional

1. Make it easy to record/update api-changes.xml files in project for PR

The api-changes.xml file is part of the configuration of revapi, it contains the changes that you know of and you want to ignore so that they don't break the build anymore, so this is the file that the developers would want to update so that it becomes part of the PR and the people can review it to help clarify things.


The way revapi initially works if enabled, it will fail the build or give a warning, and developers won't actually know what to do.

When you run revapi, it generates api-changes-suggestions.xml file in the target directory. This file contains suggestions of the new changes you might want to ignore.

The aim is to simplify this process.

I wrote a jbang script that will take the snippet in the api-suggestion.xml file and records it in the api-changes.xml file.

To run revapi use this command in any of the modules: mvn -Papi-check -Drevapi.skip=false -DskipTests verify

To run the JBang script: jbang revapi-update

Link to PR: quarkusio/quarkus/pull/26677

2. Reduce false positive from revapi output/report

There are a lot of changes happening in quarkus that should not be relevant for revapi.

The goal is about defining the right "API surface" for revapi. It should not consider changes in internal classes as breaking/incompatilbe changes.


I configured one of the revapi extensions(revapi.filter) to restrict the analysis only to quarkus extension API.

Link to PR: quarkusio/quarkus/pull/27037

3. Make output pretty/functional

The report was not easy to read.

The aim is to prettify the report and make it more useful.

Below are some screenshots of what the report now looks like:

image 1 image 1 image 1

Link to PR: quarkusio/quarkus/pull/26678


Future Goals

There's still some work to be done on improving revapi usage in Quarkus.

Here are some of the future goals:

  • Automate revapi usage in Quarkus CI build
  • Document and script for daily usage of revapi
  • Implement additonal revapi checks for i.e. property, library and configuraton changes

Acknowledgement

I want to thank my amazing mentors Max Rydahl Andersen and Lukas Krejci for their constant support and guidance through out the program, from having online meetings with me, to providing information and suggestions whenever I got stuck, to answering my almost everyday questions.

I also want to thank Google for organizing this program. It has giving me the opportunity to learn from this amazing mentors. I had a fantastic learning experience.

Some Useful Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment