Skip to content

Comments

Update CONFIG to mach package tracker 2.0#3

Open
koudis wants to merge 1 commit intomasterfrom
jan_kubalek/package_tracker2
Open

Update CONFIG to mach package tracker 2.0#3
koudis wants to merge 1 commit intomasterfrom
jan_kubalek/package_tracker2

Conversation

@koudis
Copy link
Contributor

@koudis koudis commented Feb 22, 2026

Summary by CodeRabbit

Release Notes

  • Configuration Updates
    • Enhanced support for multiple repository types (Git, Gitea, GitLab) with improved configuration handling
    • Default package branch reference updated to main
    • Streamlined HTTP authentication header configuration
    • Added URI escaping control for better path handling compatibility

@coderabbitai
Copy link

coderabbitai bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

This PR updates the example CMake configuration file, replacing HTTP authorization header handling with unified header variables, changing the default Git branch from master to main, and introducing GitLab-specific configurations including project IDs and URI escaping controls.

Changes

Cohort / File(s) Summary
Configuration Updates
config/CMCONF_EXAMPLEConfig.cmake
Added variables BA_PACKAGE_GIT_ARCHIVE_PATH_TEMPLATE, BA_PACKAGE_HTTP_HEADER, and BA_PACKAGE_TEMPLATE_ARGS_URI_ESCAPE; removed BA_PACKAGE_HTTP_AUTHORIZATION_HEADER; updated default revision to main; modified URI templates for public and GitLab repositories; replaced header authorization pattern with consolidated BA_PACKAGE_HTTP_HEADER variable; updated local path placeholder; added GitLab project ID configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Config.cmake added #2: Directly modifies the same configuration file with variable name changes, default values, and HTTP header handling updates.

Suggested reviewers

  • mikusaq

Poem

🐰 From master to main, the branch hops along,
Headers unified, authorization strong,
GitLab joins the chorus, with project IDs bright,
URI paths escaping into the light!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Update CONFIG to mach package tracker 2.0' contains a typo ('mach' should be 'match') and is somewhat vague about the specific configuration changes made to the CMake file. Consider revising the title to 'Update CMakeConfig for package tracker 2.0 compatibility' or similar to be more specific and fix the typo for clarity.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jan_kubalek/package_tracker2

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
config/CMCONF_EXAMPLEConfig.cmake (1)

23-28: Redundant commented example — identical to the active default.

Line 23 already sets BA_PACKAGE_URI_TEMPLATE_REMOTE to the exact same Gitea URL that the comment block at lines 26–28 shows as an example to uncomment. Having the same URL both active and commented directly below creates ambiguity: readers may believe they still need to act on the commented block, or may incorrectly assume the two entries are alternatives.

Consider removing or replacing the commented block with a brief note that the Gitea public URL is the current default:

♻️ Suggested clarification
-#
-# Gitea hosted public Package Repository:
-#
-#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/media/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")
+# NOTE: The active BA_PACKAGE_URI_TEMPLATE_REMOTE above already targets a Gitea public repository.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/CMCONF_EXAMPLEConfig.cmake` around lines 23 - 28, The commented
example duplicate of the active setting BA_PACKAGE_URI_TEMPLATE_REMOTE is
redundant and confusing; remove the commented CMCONF_SET(...) block (the
commented Gitea URL lines) or replace it with a single short explanatory comment
stating that the shown Gitea URL is the default value for
BA_PACKAGE_URI_TEMPLATE_REMOTE so readers don't need to uncomment—locate the
active CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE ...) entry and update the
adjacent commented block accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/CMCONF_EXAMPLEConfig.cmake`:
- Around line 34-35: The BA_PACKAGE_HTTP_HEADER example uses a literal "<token>"
while BA_PACKAGE_URI_TEMPLATE_REMOTE uses $ENV{GITLAB_TOKEN}; update the Gitea
example to reference an environment variable instead of a hardcoded token (e.g.,
change BA_PACKAGE_HTTP_HEADER "Authorization: token <token>" to use $ENV{...})
so both examples consistently show using env vars; modify the
BA_PACKAGE_HTTP_HEADER example and any neighboring comments to demonstrate
$ENV{GITEA_TOKEN} (or similar) and keep BA_PACKAGE_URI_TEMPLATE_REMOTE unchanged
aside from matching variable naming.

---

Nitpick comments:
In `@config/CMCONF_EXAMPLEConfig.cmake`:
- Around line 23-28: The commented example duplicate of the active setting
BA_PACKAGE_URI_TEMPLATE_REMOTE is redundant and confusing; remove the commented
CMCONF_SET(...) block (the commented Gitea URL lines) or replace it with a
single short explanatory comment stating that the shown Gitea URL is the default
value for BA_PACKAGE_URI_TEMPLATE_REMOTE so readers don't need to
uncomment—locate the active CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE ...) entry
and update the adjacent commented block accordingly.

Comment on lines +34 to 35
#CMCONF_SET(BA_PACKAGE_HTTP_HEADER "Authorization: token <token>")
#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/raw/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent token reference: literal <token> vs $ENV{...} in the GitLab example (line 43).

The Gitea private example at line 34 uses a literal <token> placeholder, while the GitLab example at line 43 uses $ENV{GITLAB_TOKEN}. Even in example comments, guiding users toward env-variable references is safer — it reduces the risk of someone copying the pattern and hardcoding a credential.

🔒 Suggested adjustment for consistency
-#CMCONF_SET(BA_PACKAGE_HTTP_HEADER "Authorization: token <token>")
+#CMCONF_SET(BA_PACKAGE_HTTP_HEADER "Authorization: token $ENV{GITEA_TOKEN}")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#CMCONF_SET(BA_PACKAGE_HTTP_HEADER "Authorization: token <token>")
#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/raw/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")
`#CMCONF_SET`(BA_PACKAGE_HTTP_HEADER "Authorization: token $ENV{GITEA_TOKEN}")
`#CMCONF_SET`(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/raw/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/CMCONF_EXAMPLEConfig.cmake` around lines 34 - 35, The
BA_PACKAGE_HTTP_HEADER example uses a literal "<token>" while
BA_PACKAGE_URI_TEMPLATE_REMOTE uses $ENV{GITLAB_TOKEN}; update the Gitea example
to reference an environment variable instead of a hardcoded token (e.g., change
BA_PACKAGE_HTTP_HEADER "Authorization: token <token>" to use $ENV{...}) so both
examples consistently show using env vars; modify the BA_PACKAGE_HTTP_HEADER
example and any neighboring comments to demonstrate $ENV{GITEA_TOKEN} (or
similar) and keep BA_PACKAGE_URI_TEMPLATE_REMOTE unchanged aside from matching
variable naming.

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