Skip to content

fix: detect core features properly#1147

Merged
alandtse merged 1 commit into
community-shaders:devfrom
alandtse:core_feature_issues
Jun 16, 2025
Merged

fix: detect core features properly#1147
alandtse merged 1 commit into
community-shaders:devfrom
alandtse:core_feature_issues

Conversation

@alandtse
Copy link
Copy Markdown
Collaborator

@alandtse alandtse commented Jun 15, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced VR feature list logic to conditionally build and cache features based on VR status and developer mode.
    • Refined minimal version string handling to correctly preserve non-zero patch versions.
  • Refactor

    • Simplified test INI file management by removing marker file handling and streamlining deletion checks.
  • Chores

    • Removed unused fields and outdated logic related to test marker files for a cleaner codebase.

Copilot AI review requested due to automatic review settings June 15, 2025 22:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 15, 2025

Walkthrough

The changes refine minimal version string handling by conditionally removing trailing “.0” only when present. VR feature list construction is made conditional on VR module activation and developer mode, with caching to reflect state changes. The test INI marker file mechanism is fully removed, simplifying test INI management and cleanup logic.

Changes

File(s) Change Summary
src/Feature.cpp Refined minimal version string trimming; conditional VR feature list construction with caching based on developer mode state.
src/FeatureIssues.cpp Removed all marker file handling for test INI files; simplified wasManuallyDeleted() logic; eliminated marker file persistence and related checks.
src/FeatureIssues.h Removed testMarkerPath member from FeatureIssues::Test::TestIniInfo struct.

Poem

In the warren of code, features hop anew,
Core ones get a gentle pass, as only rabbits do.
No more marker trails for tests to follow,
Just simple paths—no burrows hollow.
VR and versions, checked with care,
The code hops on, light as air!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in 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.

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
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates feature issue handling to treat VR as a core feature and removes the use of test marker paths. Key changes include:

  • Removal of the testMarkerPath field and associated logic in FeatureIssues.h and FeatureIssues.cpp.
  • Updates to logging and issue message formatting.
  • Adjustment of feature filtering behavior for VR support in Feature.cpp.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/FeatureIssues.h Removed testMarkerPath member from TestIniInfo to align with updated design.
src/FeatureIssues.cpp Removed marker file creation/deletion and adjusted logging/messaging accordingly.
src/Feature.cpp Added default minimal version for core features and refined VR filtering logic.
Comments suppressed due to low confidence (3)

src/FeatureIssues.h:189

  • The removal of the testMarkerPath member should be fully propagated; please ensure that all related persistence and logging behavior referencing this field are updated accordingly to avoid inconsistencies.
std::string testMarkerPath;   // Path to .test marker file for tracking (new files only)

src/FeatureIssues.cpp:819

  • With the removal of testMarkerPath, the wasManuallyDeleted() logic has changed; please confirm that the new logic correctly handles cases where markers previously influenced detection of manual deletion.
return !std::filesystem::exists(testIniPath);

src/Feature.cpp:225

  • [nitpick] The VR-specific feature filtering logic now always returns featuresVR; please verify that in developer mode the intended behavior (keeping all features) is maintained and clearly documented.
if (REL::Module::IsVR()) {

Copy link
Copy Markdown
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: 2

🧹 Nitpick comments (1)
src/FeatureIssues.cpp (1)

817-820: wasManuallyDeleted() now duplicates !stillExists() – consider removing one of them

After dropping the marker-file logic, stillExists() and wasManuallyDeleted() have become strict negations of each other.
That adds zero information and complicates maintenance/readability. Prefer a single predicate, e.g.:

-bool TestIniInfo::stillExists() const
-{
-    return std::filesystem::exists(testIniPath);
-}
-
-bool TestIniInfo::wasManuallyDeleted() const
-{
-    return !std::filesystem::exists(testIniPath);
-}
+bool TestIniInfo::IsPresent() const
+{
+    return std::filesystem::exists(testIniPath);
+}

…or simply inline the check at call-sites.
This keeps the API minimal and avoids “two ways of saying the same thing”.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e15793 and d8c60b7.

📒 Files selected for processing (3)
  • src/Feature.cpp (2 hunks)
  • src/FeatureIssues.cpp (2 hunks)
  • src/FeatureIssues.h (0 hunks)
💤 Files with no reviewable changes (1)
  • src/FeatureIssues.h
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Validate PR title
  • GitHub Check: Check for changes in PRs
🔇 Additional comments (1)
src/Feature.cpp (1)

72-88: Risk of silently accepting out-of-date core features

When a core feature is missing from FEATURE_MINIMAL_VERSIONS, the code now falls back to a hard-coded 1.0.0:

minimalVersion = REL::Version("1.0.0");

If the real minimal version later becomes 1.2.0, older installs will pass the check unnoticed, defeating the intent of the map.

Recommend either

  1. adding every core feature to the map (preferred) and treating absence as a programming error (e.g. SKSE::log::critical + abort), or
  2. deriving the fallback from the DLL’s own version instead of a constant.

Fail-fast here avoids hard-to-trace mismatches in the field.

Comment thread src/Feature.cpp Outdated
Comment thread src/Feature.cpp Outdated
@alandtse alandtse force-pushed the core_feature_issues branch from bc8cbc3 to bf33ccb Compare June 16, 2025 03:46
@alandtse alandtse changed the title fix: treat VR as a core feature for issue detection fix: detect core features properly Jun 16, 2025
@github-actions
Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@alandtse
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 16, 2025

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
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: 0

🔭 Outside diff range comments (1)
src/Feature.cpp (1)

91-93: ⚠️ Potential issue

Fix unconditional trim – non-zero patch numbers are still cut off

This block still strips the last two characters of minimalVersionString regardless of the patch value, undoing the safety check you added later (lines 131-136).
Users will again see misleading requirements like 1.2 instead of 1.2.4.

-std::string minimalVersionString = minimalFeatureVersion.string();
-minimalVersionString = minimalVersionString.substr(0, minimalVersionString.size() - 2);
+std::string minimalVersionString = minimalFeatureVersion.string();
+if (minimalVersionString.ends_with(".0")) {     // remove only a trailing “.0”
+    minimalVersionString.erase(minimalVersionString.size() - 2);
+}
🧹 Nitpick comments (1)
src/FeatureIssues.cpp (1)

817-820: wasManuallyDeleted() now mirrors !stillExists() — consider consolidation

Since both methods are logical complements (stillExists()exists, wasManuallyDeleted()!exists), the dual calls in the stats loop (lines 910-919) are now redundant.
Either drop one of the methods or rewrite wasManuallyDeleted() to convey extra intent (e.g., track previous existence via persisted state).

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a25f25 and bf33ccb.

📒 Files selected for processing (3)
  • src/Feature.cpp (2 hunks)
  • src/FeatureIssues.cpp (1 hunks)
  • src/FeatureIssues.h (0 hunks)
💤 Files with no reviewable changes (1)
  • src/FeatureIssues.h
🔇 Additional comments (1)
src/Feature.cpp (1)

218-245: Dynamic VR-aware cache looks solid

👍 The new BuildVRList helper together with featuresVR and cachedDevMode correctly rebuilds the list when Developer Mode changes, eliminating the stale-cache issue flagged earlier. No further action required.

@alandtse alandtse merged commit 3e5b6c7 into community-shaders:dev Jun 16, 2025
14 checks passed
alandtse added a commit that referenced this pull request Jun 20, 2025
@alandtse alandtse deleted the core_feature_issues branch June 20, 2025 17:30
davo0411 pushed a commit to davo0411/skyrim-community-shaders that referenced this pull request Jun 21, 2025
alandtse referenced this pull request in alandtse/open-shaders Jun 21, 2025
fix: detect core features properly (doodlum#1147)
alandtse added a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Sep 18, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Apr 9, 2026
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.

3 participants