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

Configuration - TCL OCCT version extraction issue #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dpasukhi
Copy link
Owner

@dpasukhi dpasukhi commented Feb 3, 2025

Enhance version detection in OCCDoc_DetectCasVersion

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced version detection with improved error handling, ensuring reliable performance even when expected version data isn’t available.
  • New Features

    • Introduced an automated documentation generation step in the CI/CD pipeline, streamlining the process and improving the delivery of up-to-date project documentation.

Enhance version detection in OCCDoc_DetectCasVersion
Copy link

coderabbitai bot commented Feb 3, 2025

Walkthrough

This pull request enhances the robustness of the OCC version detection in the adm/occaux.tcl script by dynamically constructing file paths and adding error handling. In parallel, the documentation build workflow has been restructured into a composite action format by updating the action configuration and removing branch trigger conditions. Additionally, the multi-platform CI/CD pipeline now includes a dedicated documentation job that utilizes the updated composite action for building OCCT documentation.

Changes

File(s) Change Summary
adm/occaux.tcl Modified the OCCDoc_DetectCasVersion procedure to construct the file path dynamically, improved regex extraction, and added robust error handling with warnings.
.github/actions/build-docs/action.yml
.github/workflows/build-and-test-multiplatform.yml
Restructured the documentation build workflow into a composite action format by updating shell commands and removing trigger conditions; added a new documentation job in the workflow for Windows.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller
    participant Proc as OCCDoc_DetectCasVersion
    participant FS as File System
    
    Caller->>Proc: Call OCCDoc_DetectCasVersion
    Proc->>FS: Construct dynamic file path and check existence
    alt File exists
       Proc->>FS: Open and read file (with try/catch)
       FS-->>Proc: Return file content or error
       alt Successful read
           Proc->>Proc: Extract version using regex
           Proc-->>Caller: Return constructed version string
       else Error during read
           Proc->>Caller: Output warning and return default version
       end
    else File missing
       Proc-->>Caller: Return default version
    end
Loading
sequenceDiagram
    participant CI as GitHub CI
    participant Checkout as actions/checkout (v4.2.1)
    participant BuildDocs as Build-Docs Composite Action
    participant Artifact as Artifact Upload

    CI->>Checkout: Checkout repository
    Checkout-->>CI: Repository contents
    CI->>BuildDocs: Execute documentation build action
    BuildDocs-->>CI: Generate documentation
    CI->>Artifact: Upload generated docs and logs
    Artifact-->>CI: Documentation published
Loading

Poem

I'm a little bunny hopping through code,
Tweaks and changes light my mode.
Files now dance with error-catching flair,
Each commit a joyful, bouncy air.
With whiskers twitching at every new line,
My furry heart celebrates each design.
Hooray for change and the art of code!


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/actions/build-docs/action.yml (1)

41-47: Indentation Consistency—YAMLlint Warning
YAMLlint has flagged an indentation issue at line 41 (“Upload overview documentation”). Although all steps appear to be aligned similarly, the linter expected an extra level of indentation (6 spaces instead of 4) for this block. Please verify whether the composite action schema requires list items under steps: to be indented with 6 spaces relative to the file’s root. If so, a diff such as the one below can resolve the warning:

-    - name: Upload overview documentation
-      uses: actions/[email protected]
-      with:
-        name: overview-doc
-        path: doc/overview
-        retention-days: 90
+      - name: Upload overview documentation
+        uses: actions/[email protected]
+        with:
+          name: overview-doc
+          path: doc/overview
+          retention-days: 90

Adjusting the indentation in this manner (and verifying it against GitHub’s composite action documentation) should clear the YAMLlint warning.

.github/workflows/build-and-test-multiplatform.yml (1)

36-46: New Documentation Job Added
A new job named documentation has been introduced to build OCCT documentation on a Windows-2022 runner using the custom composite action defined in ./.github/actions/build-docs. The checkout step here uses a slightly newer version (v4.2.1) compared to some other jobs (which use v4.1.7). While the implementation is clear and aligns with the objective of integrating documentation builds into the CI/CD process, consider standardizing the version of actions/checkout across all jobs for consistency. For example, if updating all to v4.2.1 is acceptable, then use:

-      uses: actions/[email protected]
+      uses: actions/[email protected]

This minor consistency adjustment would be good to have.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 41-41: wrong indentation: expected 6 but found 4

(indentation)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1bf2655 and eceed68.

📒 Files selected for processing (2)
  • .github/actions/build-docs/action.yml (1 hunks)
  • .github/workflows/build-and-test-multiplatform.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/build-and-test-multiplatform.yml

[warning] 41-41: wrong indentation: expected 6 but found 4

(indentation)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Prepare and Build on Windows with Clang (x64)
  • GitHub Check: Prepare and Build on Ubuntu with GCC (x64)
  • GitHub Check: Prepare and Build on Ubuntu with Clang (x64)
  • GitHub Check: Build Documentation
  • GitHub Check: Prepare and Build on Windows with MSVC (x64)
🔇 Additional comments (7)
.github/actions/build-docs/action.yml (7)

1-3: Clarify the Action Metadata and Description
The header now clearly names the action as “Build Documentation” and adds a useful description about using Doxygen to build OCCT documentation. This improves discoverability and clarity.


4-6: Adoption of Composite Action Structure
The change to a composite action (using using: composite) simplifies the configuration and makes the action more modular. The structure appears correct overall.


7-11: Installation Step Review
The “Install dependencies” step installs Graphviz and Doxygen via Chocolatey and now specifies PowerShell as the shell. The implementation is clear and straightforward.


13-19: Building the Refman Documentation
The step for building the “refman” documentation is well defined with a clear command block. Ensure that the gendoc -refman utility in the adm folder reliably produces the intended outputs under different environments.


20-26: Uploading Refman Documentation Artifacts
The configuration to upload the generated refman documentation is correct. The artifact name, path, and retention-days parameters are appropriately set.


27-33: Uploading Generation Log
The step to upload the generation log artifact is implemented consistently with other artifact uploads. This aids in troubleshooting documentation generation errors.


34-40: Building Documentation Overview
The “Build documentation Overview” step mirrors the earlier build step and is clear in its commands. Consistency in using Command Prompt (cmd) for this step is maintained.

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.

1 participant