Skip to content

Conversation

Choconaut
Copy link

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
<artifactId>operator-annotations</artifactId>

<properties>
<maven.compiler.source>22</maven.compiler.source>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure these properties are needed here since they should probably be inherited from the parent. Also, this code should work with Java 21.

@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 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.

Marks integration test classes so that markdown pages can be auto generated.
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
@csviri csviri force-pushed the docs-sample-annotation branch from 7e9be4a to feab885 Compare October 14, 2025 15:55
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