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

[TT-1725] doc generating pipeline #1447

Merged
merged 28 commits into from
Dec 9, 2024
Merged

Conversation

Tofel
Copy link
Contributor

@Tofel Tofel commented Dec 6, 2024

This PR adds a new workflow that generates go doc for public functions modified in the PR, if they do not have any function docs.

It is triggered only when label generate_go_docs is present.

You can see it in action here, where it added comment for functions from this PR.


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes enhance the GitHub Actions workflow for automatically generating Go documentation upon pull request updates. They streamline the process by adjusting the trigger to react to pull request label changes, improving security through the use of GitHub tokens, and refining the documentation generation process to only include changed modules. This ensures that documentation is efficiently updated in a secure manner, focusing only on the parts of the codebase that have been modified.

What

  • .github/workflows/generate-go-docs.yaml
    • Changed the trigger condition from issue labels to pull request labels to more accurately initiate the workflow.
    • Updated permissions to include id-token: write for enhanced security and adjusted contents: read permission.
    • Added steps for setting up GitHub tokens and configuring Git for private repository access. This includes installing necessary Go tools with specific versions, which ensures the workflow has the required permissions and tools to execute securely and successfully.
    • Replaced static branch and PR details extraction with a dynamic change detection step using dorny/paths-filter action. This optimizes the workflow by focusing on the parts of the codebase that have been modified.
    • Removed unnecessary Git setup and PR details extraction steps as they are no longer needed with the new dynamic change detection approach.
    • Introduced a new step to find and filter all Go modules in the repository that have changes. This ensures that documentation is only generated for the parts of the codebase that were updated.
    • Updated the Go documentation generation step to act only on the changed projects, making the process more efficient.
    • Added steps to upload the costs as an artifact and then remove them before committing, maintaining a clean state.
    • Adjusted the GitHub token setup for creating a new PR to use a more secure method.
    • Modified the PR creation step to use an updated version of the peter-evans/create-pull-request action and to dynamically set the branch, base, title, and body according to the current PR context. This ensures the documentation PR is accurately targeted and described.

@Tofel Tofel force-pushed the tt-1725-doc-generating-pipeline branch from b8b9937 to 17d91a0 Compare December 6, 2024 11:27
@Tofel Tofel marked this pull request as ready for review December 6, 2024 11:27
@Tofel Tofel requested review from sebawo and a team as code owners December 6, 2024 11:28
@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@Tofel Tofel merged commit aee82bd into main Dec 9, 2024
45 of 46 checks passed
@Tofel Tofel deleted the tt-1725-doc-generating-pipeline branch December 9, 2024 10:21
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.

2 participants