Skip to content

Conversation

faukah
Copy link
Contributor

@faukah faukah commented Sep 13, 2025

The version checking workflow has been failing for some time, here's a bump of the searching version.

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • Style and consistency
    • I ran nix fmt to format my Nix code
    • I ran cargo fmt to format my Rust code
    • I have added appropriate documentation to new code
    • My changes are consistent with the rest of the codebase
  • Correctness
    • I ran cargo clippy and fixed any new linter warnings.
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas to explain the
      logic
    • I have documented the motive for those changes in the PR body or commit
      description.
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

Summary by CodeRabbit

  • New Features

    • Search now targets the latest 44 channel, ensuring results reflect the newest release.
  • Chores

    • Updated CI workflow to validate against version 44.

Copy link

coderabbitai bot commented Sep 13, 2025

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

Bumps version references from 43 to 44 in two places: the GitHub Actions workflow check and the search client’s backend URL path. No other logic, authentication, or response handling changes.

Changes

Cohort / File(s) Summary of Changes
CI version check update
.github/workflows/nixos-search.yaml
Updated expected VERSION_NUMBER from 43 to 44 in the workflow comparison step; logic to fetch, trim, compare, and report remains unchanged.
Search backend endpoint bump
src/search.rs
Changed POST URL path from latest-43-{channel} to latest-44-{channel}; request construction and handling unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "search: update nixos-search version" is concise and accurately describes the primary change in this PR — bumping the nixos-search version (endpoint and workflow) — and is specific enough for a teammate scanning history to understand the main intent.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

@faukah
Copy link
Contributor Author

faukah commented Sep 13, 2025

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...
📥 Commits

📒 Files selected for processing (2)

 ________________________________________________________________________________________________________________________________
< Test state coverage, not code coverage. Identify and test significant program states. Just testing lines of code isn't enough. >
 --------------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Tip
You can make CodeRabbit's review stricter and more nitpicky using the assertive profile, if that's what you prefer.

✨ Finishing touches

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.

@coderabbitai stop your AI slop thx

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 (3)
src/search.rs (1)

133-137: Optional: avoid hardcoding the backend version in the URL

Define a single const and interpolate it to reduce future drift.

Apply this diff to the URL line:

-                "https://search.nixos.org/backend/latest-44-{channel}/_search"
+                "https://search.nixos.org/backend/latest-{NIXOS_SEARCH_BACKEND_VERSION}-{channel}/_search"

Add this near the other top-level consts:

const NIXOS_SEARCH_BACKEND_VERSION: u8 = 44;
.github/workflows/nixos-search.yaml (2)

16-18: Nit: possessive “its”, not “it’s”

Minor grammar fix in the comment.

-          # to be updated when nixos-search updates it's version number.
+          # to be updated when nixos-search updates its version number.

12-28: Harden the check and prevent drift with the code

Add strict shell flags, fail on curl errors, validate content, and assert that src/search.rs uses the same version.

       - name: Check nixos-search version
         run: |
+          set -euo pipefail
-          VERSION_CONTENT=$(curl --silent "https://raw.githubusercontent.com/nixos/nixos-search/main/VERSION" | tr -d '[:space:]')
+          VERSION_CONTENT=$(curl -fsSL "https://raw.githubusercontent.com/nixos/nixos-search/main/VERSION" | tr -d '[:space:]')
           # NOTE: this number and the version number in src/search.rs have
           # to be updated when nixos-search updates it's version number.
           VERSION_NUMBER=44
+
+          if ! echo "$VERSION_CONTENT" | grep -Eq '^[0-9]+$'; then
+            echo "::error:: Invalid VERSION content: '$VERSION_CONTENT'"
+            exit 1
+          fi
 
           echo "Found VERSION: $VERSION_CONTENT"
 
           if [ "$VERSION_CONTENT" != "$VERSION_NUMBER" ]; then
             echo "::error:: Expected version $VERSION_NUMBER, but found $VERSION_CONTENT"
             exit 1
           fi
+
+          # Assert the code uses the same version in the backend URL
+          if ! grep -Rqn -- "latest-$VERSION_NUMBER-" src/search.rs ; then
+            echo "::error:: src/search.rs is not using backend version $VERSION_NUMBER"
+            exit 1
+          fi
 
           echo "Version check passed. nixos-search version is $VERSION_NUMBER."
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a818218 and df9fdd6.

📒 Files selected for processing (2)
  • .github/workflows/nixos-search.yaml (1 hunks)
  • src/search.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build NH on Linux
  • GitHub Check: Build NH on Darwin
  • GitHub Check: treewide-checks
  • GitHub Check: Test NH on Darwin
  • GitHub Check: Test NH on Linux
🔇 Additional comments (2)
src/search.rs (1)

133-137: LGTM: bump to backend API v44 matches upstream

Confirmed nixos-search VERSION is 44 on September 13, 2025; the URL change to latest-44-{channel} is correct and aligned with the workflow. (raw.githubusercontent.com)

.github/workflows/nixos-search.yaml (1)

16-19: LGTM: VERSION_NUMBER=44 is correct (upstream is 44 as of today)

Matches the backend URL in src/search.rs; upstream VERSION currently reads “44”. (raw.githubusercontent.com)

Copy link

coderabbitai bot commented Sep 13, 2025

@faukah I understand - I've paused the automated reviews for this PR.

✅ Actions performed

Reviews paused.

@faukah
Copy link
Contributor Author

faukah commented Sep 13, 2025

tested, werks.

@NotAShelf NotAShelf merged commit 8bf3234 into nix-community:master Sep 14, 2025
8 checks passed
@faukah faukah deleted the update-search branch September 14, 2025 10:37
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