Skip to content

CI/CD - update to use CMakeLib v1.2.0#2

Merged
koudis merged 9 commits intomainfrom
ci_cd_fix
Aug 4, 2025
Merged

CI/CD - update to use CMakeLib v1.2.0#2
koudis merged 9 commits intomainfrom
ci_cd_fix

Conversation

@koudis
Copy link
Member

@koudis koudis commented Aug 2, 2025

Summary by CodeRabbit

  • Chores
    • Updated the workflow environment to use version 1.2.1 of the cmakelib repository in example and test jobs across all platforms.
    • Added a new environment variable to improve path handling in example and test jobs on Linux, Windows, and macOS.
    • Introduced symbolic link creation steps and enhanced configuration options in example workflows for better environment setup.
  • Bug Fixes
    • Improved test reliability by refining the test process for handling missing environment variables, ensuring accurate failure detection.
    • Enhanced uninstall process on Windows to safely remove package registry entries with improved error handling.
  • New Features
    • Added a new test case to verify proper uninstallation and package registry cleanup.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 2, 2025

Warning

Rate limit exceeded

@koudis has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f93d66b and 1dd4498.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • test/README.md (1 hunks)

Walkthrough

The CMLIB_VERSION environment variable was updated from 1.1.0 to 1.2.1 in both the example and test GitHub Actions workflow files. The example workflow was enhanced to set a new environment variable CMLIB_COMPONENT_LOCAL_BASE_PATH to the current working directory and create symbolic links named cmakelib-component-cmconf in Linux, Windows, and macOS example jobs. The CMake invocation was updated to include the option -DCMCONF_INSTALL_AS_SYMLINK=ON. In the test workflow, similar environment variables were set in Linux, macOS, and Windows test jobs with directory listings added in Linux. Additionally, a test case for missing HOME environment variable was changed to explicitly run and check process results instead of using a macro. The uninstall logic in CMCONF.cmake was revised on Windows to query and delete registry keys for package uninstallation instead of directly removing directories, adding error handling for missing tools or failed commands. A new uninstall verification test was added, and the Windows-specific failure test for missing USERPROFILE was removed.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow: Examples
.github/workflows/examples.yml
Updated CMLIB_VERSION from 1.1.0 to 1.2.1; added CMLIB_COMPONENT_LOCAL_BASE_PATH set to current directory in Linux, Windows, and macOS example jobs; created symbolic link cmakelib-component-cmconf pointing to current directory; updated CMake invocation to include -DCMCONF_INSTALL_AS_SYMLINK=ON.
GitHub Actions Workflow: Tests
.github/workflows/tests.yml
Updated CMLIB_VERSION from 1.1.0 to 1.2.1; set CMLIB_COMPONENT_LOCAL_BASE_PATH in Linux, macOS, and Windows test jobs to parent directory; added directory listing in Linux job before running cmake.
Test Case Modifications and Additions
test/test_cases/fail/unix_home_missing/CMakeLists.txt, test/test_cases/fail/windows_userprofile_missing/* (deleted), test/test_cases/pass/uninstall_verification/CMakeLists.txt, test/CMakeLists.txt
Replaced macro-based test invocation with explicit EXECUTE_PROCESS call to run CMake script and verify error output for missing HOME environment variable; removed Windows USERPROFILE missing failure test case and its test configuration files; added new uninstall verification test case checking registry state before and after uninstall; updated test suite to include new uninstall verification and remove Windows failure test.
Uninstall Logic Update
CMCONF.cmake
Revised _CMCONF_UNINSTALL function on Windows to query and delete package registry keys via reg command instead of removing directories; added error handling for missing reg tool and failed deletion commands; preserved Unix uninstall logic and added fatal error for unsupported platforms.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Tests #1: Initial .github/workflows/examples.yml workflow file setup with example jobs and CMLIB_VERSION environment variable. This PR extends and modifies the same workflow file and job definitions.

Poem

A hop and a skip, a version anew,
CMLIB hops from one-point-one to one-point-two.
Paths set with care, the base now in sight,
Links made with grace on all platforms' light.
Tests refined with checks more clear,
Windows uninstall now handles with cheer.
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci_cd_fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @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
Contributor

@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: 1

♻️ Duplicate comments (1)
.github/workflows/tests.yml (1)

12-14: Same version-consistency concern as noted in examples.yml.
See previous comment; apply any necessary correction here as well.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b7a6186 and 54945d1.

📒 Files selected for processing (2)
  • .github/workflows/examples.yml (1 hunks)
  • .github/workflows/tests.yml (1 hunks)

Copy link
Contributor

@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: 1

🧹 Nitpick comments (3)
.github/workflows/tests.yml (3)

44-45: Symlink creation not idempotent

ln -s ./ cmakelib-component-cmconf fails on reruns if the link already exists. Use force‐overwrite and relative target for safety:

-ln -s ./ cmakelib-component-cmconf
+ln -sfn "$(pwd)" cmakelib-component-cmconf

47-47: Trailing whitespace flagged by YAML-lint

Line 47 contains trailing spaces. Remove them to keep the workflow lint-clean.


77-77: Add newline at end of file

YAML-lint reports a missing terminating newline. Append one to avoid tooling warnings.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1355c2b and bd6a164.

📒 Files selected for processing (2)
  • .github/workflows/examples.yml (4 hunks)
  • .github/workflows/tests.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/examples.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/tests.yml

[error] 47-47: trailing spaces

(trailing-spaces)


[error] 77-77: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
.github/workflows/tests.yml (1)

12-14: Version bump conflicts with PR objective

CMLIB_VERSION is set to 1.2.1, while the PR title states an update to v1.2.0. Confirm the intended version and keep the title, commit message and workflow in sync to avoid confusion during future roll-backs or bisects.

Copy link
Contributor

@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: 1

🧹 Nitpick comments (1)
test/test_cases/fail/unix_home_missing/CMakeLists.txt (1)

19-24: Add a timeout and suppress unused output variable

EXECUTE_PROCESS can hang indefinitely if the child CMake process blocks (e.g. waiting for input).
Adding a small TIMEOUT (even 30 s) protects CI from stalling.
Additionally, the output capture is never used; suppress it to avoid allocating an unnecessary string.

 EXECUTE_PROCESS(
     COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/test_config/CMakeLists.txt"
+    TIMEOUT 30
     RESULT_VARIABLE result
     ERROR_VARIABLE error_output
-    OUTPUT_VARIABLE output
+    OUTPUT_QUIET
 )
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bd6a164 and 5d3eca9.

📒 Files selected for processing (1)
  • test/test_cases/fail/unix_home_missing/CMakeLists.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: the cmake_language(defer) construct is not available in cmake script mode, only in project mode, mak...
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmconf#1
File: test/test_cases/fail/variable_not_defined/CMakeLists.txt:17-23
Timestamp: 2025-08-02T17:36:23.478Z
Learning: The cmake_language(DEFER) construct is not available in CMake script mode, only in project mode, making it unsuitable for tests that need to run in both modes.

Applied to files:

  • test/test_cases/fail/unix_home_missing/CMakeLists.txt

@koudis koudis force-pushed the ci_cd_fix branch 2 times, most recently from 2987324 to c1c5512 Compare August 4, 2025 18:05
@koudis koudis merged commit 196573f into main Aug 4, 2025
14 checks passed
@koudis koudis deleted the ci_cd_fix branch August 7, 2025 09:42
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

Comments