Skip to content

Conversation

@amezin
Copy link
Member

@amezin amezin commented Sep 26, 2025

Summary by CodeRabbit

  • Chores
    • Enhanced build system validation to verify GNOME Shell version compatibility. Version strings are now normalized across different formats and validated against required ranges with improved error detection during build.

✏️ Tip: You can customize this high-level summary in your review settings.

@amezin amezin force-pushed the meson-shell-versions-check branch from 2625685 to b29ee21 Compare December 26, 2025 14:41
@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

A runtime validation is added to meson.build that normalizes GNOME Shell versions and verifies each version satisfies the required range gnome_shell_req. Short versions (e.g., 46, 47) are expanded to full version strings, then checked against the allowed range with error emission on mismatch.

Changes

Cohort / File(s) Summary
Build Configuration Validation
meson.build
Adds version validation logic that expands short GNOME Shell versions to full strings and verifies each against the required version range; emits error if validation fails while preserving existing downstream logic

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop through versions, neat and true,
Each shell expanded, matching too—
From 46 to alpha's call,
Validation ensures they fit us all! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding validation in meson.build to verify that shell_versions align with gnome_shell_req.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch meson-shell-versions-check

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

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad1c2ab and b29ee21.

📒 Files selected for processing (1)
  • meson.build
🧰 Additional context used
🪛 GitHub Check: ci / bundle
meson.build

[failure] 51-51:
Problem encountered: Shell version 46.alpha does not match >=46.0


[failure] 51-51:
Problem encountered: Shell version 46.alpha does not match >=46.0

Comment on lines +38 to +46
foreach shell_version : shell_versions
if shell_version.contains('.')
shell_versions_expanded += [shell_version]
else
foreach suffix : ['0', '1', '9', 'alpha', 'beta', 'rc']
shell_versions_expanded += f'@shell_version@.@suffix@'
endforeach
endif
endforeach
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Pre-release version suffixes cause validation to fail.

The expansion logic includes 'alpha', 'beta', and 'rc' suffixes, which create pre-release versions (e.g., 46.alpha) that semantically come before the corresponding release version (e.g., 46.0). In version comparison semantics, 46.alpha < 46.0, so these pre-release versions fail the >=46.0 requirement.

This is causing the CI failure: Shell version 46.alpha does not match >=46.0

To validate that short versions like "46" fall within the required range, you only need to check the .0 release version. The additional minor versions ('1', '9') and pre-release suffixes are unnecessary and cause false negatives.

🔎 Proposed fix

Remove the problematic suffixes and only check .0 for short versions:

 foreach shell_version : shell_versions
   if shell_version.contains('.')
     shell_versions_expanded += [shell_version]
   else
-    foreach suffix : ['0', '1', '9', 'alpha', 'beta', 'rc']
-      shell_versions_expanded += f'@shell_version@.@suffix@'
-    endforeach
+    shell_versions_expanded += f'@[email protected]'
   endif
 endforeach
📝 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
foreach shell_version : shell_versions
if shell_version.contains('.')
shell_versions_expanded += [shell_version]
else
foreach suffix : ['0', '1', '9', 'alpha', 'beta', 'rc']
shell_versions_expanded += f'@shell_version@.@suffix@'
endforeach
endif
endforeach
foreach shell_version : shell_versions
if shell_version.contains('.')
shell_versions_expanded += [shell_version]
else
shell_versions_expanded += f'@[email protected]'
endif
endforeach
🤖 Prompt for AI Agents
In meson.build around lines 38 to 46 the expansion of short shell versions
incorrectly adds pre-release suffixes ('alpha','beta','rc') and unnecessary
minor versions, producing versions like "46.alpha" which compare lower than
"46.0" and fail the ">=46.0" check; change the expansion so that when a short
version (no dot) is encountered only the ".0" release variant is added (remove
'alpha','beta' and other extra suffixes and minor variants) so validation checks
use e.g. "46.0" only.

Comment on lines +48 to +54
foreach shell_version : shell_versions_expanded
foreach shell_version_req : gnome_shell_req
if not shell_version.version_compare(shell_version_req)
error(f'Shell version @shell_version@ does not match @shell_version_req@')
endif
endforeach
endforeach
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider simplifying the validation approach.

Once the expansion logic is fixed to only include .0 versions for short version strings, this nested loop validation will work correctly. However, checking one representative version (e.g., "46.0") per short version (e.g., "46") is sufficient to verify that the shell version falls within the required range.

The current nested loop approach is correct but potentially over-engineered for this use case.

🧰 Tools
🪛 GitHub Check: ci / bundle

[failure] 51-51:
Problem encountered: Shell version 46.alpha does not match >=46.0


[failure] 51-51:
Problem encountered: Shell version 46.alpha does not match >=46.0

🤖 Prompt for AI Agents
In meson.build around lines 48 to 54, the nested foreach loops validate every
expanded shell version against every requirement which is more complex than
necessary; instead, after fixing expansion to produce only .0 variants for short
versions, reduce validation to check a single representative expanded version
per short version (e.g., "46.0" for "46") against the gnome_shell_req list:
deduplicate or map short->representative expanded version and iterate that
reduced set, performing version_compare against the requirements and erroring if
any representative version does not satisfy the requirement.

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