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 git support for compatibility checker #17684

Open
wants to merge 11 commits into
base: trunk
Choose a base branch
from

Conversation

mannoopj
Copy link
Contributor

@mannoopj mannoopj commented Nov 4, 2024

Add git support for schema compatibility checker. Pulls in valid schema from remote git trunk branch to check with edited schema in local branch. Adds new option for command line verify-evolution-git which takes in a required file name

@mannoopj mannoopj marked this pull request as draft November 4, 2024 14:59
@github-actions github-actions bot added tools build Gradle build or GitHub Actions generator RPC and Record code generator labels Nov 4, 2024
@mannoopj mannoopj marked this pull request as ready for review November 5, 2024 15:28
String fileCheckMetadata = namespace.getString("file");
String gitContent = GetDataFromGit(fileCheckMetadata);
EvolutionVerifier verifier = new EvolutionVerifier(
CheckerUtils.readMessageSpecFromFile(Paths.get("").toAbsolutePath().getParent() + "/metadata/src/main/resources/common/metadata/" + fileCheckMetadata),
Copy link
Contributor

Choose a reason for hiding this comment

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

in general I don't understand what the strategy is here for paths. if you are using a relative path, you need to document what directory we need to be in. how are we locating the git repository root?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok yeah I added documentation in the help output stating that this tool is expected to be run from the generator directory. That was the assumption I was working under. Getting the git root repo is done in the GetDataFromGit function in CheckerUtil.java

Copy link
Contributor

Choose a reason for hiding this comment

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

If we know where the git repo root is, why can't we just change to that directory rather than requiring a specific current working directory?

Copy link
Contributor Author

@mannoopj mannoopj Nov 21, 2024

Choose a reason for hiding this comment

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

I changed to code so it works anywhere within the kafka directory. Im trying to get the absolute path to the kafka directory so that I can use that to git repo through jgit

@github-actions github-actions bot added the small Small PRs label Nov 12, 2024
@@ -32,6 +32,8 @@
files="(ApiMessageType|FieldSpec|MessageDataGenerator|KafkaConsumerTest).java"/>
<suppress checks="MethodLength"
files="(FieldSpec|MessageDataGenerator).java"/>
<suppress checks="ImportControl"
Copy link
Contributor

Choose a reason for hiding this comment

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

why can we not just list org.eclipse.jgit as allowed?

Copy link
Contributor Author

@mannoopj mannoopj Nov 21, 2024

Choose a reason for hiding this comment

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

Was having trouble testing to so added it in the suppressions. Figured out I was having a local issue so this is just added to the allowed import controls now.

@github-actions github-actions bot removed the small Small PRs label Nov 21, 2024
@github-actions github-actions bot added the small Small PRs label Nov 21, 2024
Copy link
Contributor

@cmccabe cmccabe left a comment

Choose a reason for hiding this comment

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

LGTM

@cmccabe
Copy link
Contributor

cmccabe commented Nov 21, 2024

@mannoopj : there are checkstyle issues, can you fix?

Copy link
Contributor

@cmccabe cmccabe left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Gradle build or GitHub Actions generator RPC and Record code generator small Small PRs tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants