Skip to content

Conversation

@Choconaut
Copy link

Marks integration test classes so that markdown pages can be auto generated.

Marks integration test classes so that markdown pages can be auto generated.
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 21, 2025
@Choconaut
Copy link
Author

I wasn't sure where to place @sample, so I put it in a temporary module for now. I thought about putting it in sample-operators. Do you have any recommendations? I'm happy to move it.

@csviri
Copy link
Collaborator

csviri commented Sep 22, 2025

I think that is fine by now, since the implementation will be I guess an annotation processor.

@csviri csviri linked an issue Sep 22, 2025 that may be closed by this pull request
refactor: remove unneeded properties in pom.xml
Implemented a sample processor to scan all samples and write the tldr/description to a md file

Moved Sample.java to the annotation package
@Choconaut Choconaut marked this pull request as ready for review October 14, 2025 03:56
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 03:56
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 14, 2025
@openshift-ci openshift-ci bot requested review from csviri and metacosm October 14, 2025 03:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a @Sample annotation and corresponding annotation processor to enable automatic generation of markdown documentation from integration test classes. The feature allows developers to mark test classes with metadata that gets compiled into a samples.md file for documentation purposes.

  • Adds a new @Sample annotation with tldr and description fields for marking integration test classes
  • Implements a SampleProcessor annotation processor that collects annotated classes and generates markdown output
  • Creates a new Maven module operator-annotations to house the annotation infrastructure

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pom.xml Adds the new operator-annotations module to the parent POM
operator-annotations/pom.xml Defines the new Maven module for annotation processing
operator-annotations/src/main/java/io/javaoperatorsdk/annotation/Sample.java Defines the @sample annotation with tldr and description fields
operator-annotations/src/main/java/io/javaoperatorsdk/processor/SampleProcessor.java Implements the annotation processor that generates samples.md from annotated classes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +55 to +56
/**
*
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Empty Javadoc comment should either be removed or contain meaningful documentation describing the method's purpose, parameters, and behavior.

Suggested change
/**
*
/**
* Writes a markdown file named {@code samples.md} listing all provided samples.
* Each sample is written as a section with its TLDR and description.
*
* @param samples the list of samples to include in the markdown file
* @throws RuntimeException if an I/O error occurs during file writing

Copilot uses AI. Check for mistakes.
@csviri csviri force-pushed the docs-sample-annotation branch from 7e9be4a to feab885 Compare October 14, 2025 15:55
@csviri
Copy link
Collaborator

csviri commented Oct 23, 2025

Hi @Choconaut , looks good maybe what we could do is to use this now in operator-framework module and annotate one test with the annotation and see how the result looks.

@Choconaut Choconaut force-pushed the docs-sample-annotation branch 2 times, most recently from 62da213 to ad9cb00 Compare October 26, 2025 06:39
This commit also adds an example sample annotation to the CRDMappingInTestExtensionIT class to test the sample annotation processor.
@Choconaut Choconaut force-pushed the docs-sample-annotation branch from ad9cb00 to db5b9b2 Compare October 26, 2025 06:43
This commit also adds an example sample annotation to the CRDMappingInTestExtensionIT class to test the sample annotation processor.
@Choconaut
Copy link
Author

Hi @Choconaut , looks good maybe what we could do is to use this now in operator-framework module and annotate one test with the annotation and see how the result looks.

Hi, I added the sample annotations to these 2 classes: RDMappingInTestExtensionIT.java, ChangeNamespaceIT.java in operator-framework. Let me know if there's anything I should change.

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.

Generate Docs from Integration Test

3 participants