Skip to content

Change how we trace the path of results#1532

Merged
henriquemoody merged 1 commit into
Respect:mainfrom
henriquemoody:core/only-paths
Dec 21, 2025
Merged

Change how we trace the path of results#1532
henriquemoody merged 1 commit into
Respect:mainfrom
henriquemoody:core/only-paths

Conversation

@henriquemoody

@henriquemoody henriquemoody commented Mar 24, 2025

Copy link
Copy Markdown
Member

Currently, we’re using scalar values to trace paths. The problem with that approach is that we can’t create a reliable hierarchy with them, as we can’t know for sure when a path is the same for different rules. By using an object, we can easily compare and create a parent-child relationship with it.

While making these changes, I deemed it necessary to also create objects to handle Name and Id, which makes the code simpler and more robust. By having Name and Path, we can create specific stringifiers that allow us to customise how we render those values.

I didn’t manage to make those changes atomically, which is why this commit makes so many changes. I found myself moving back and forth, and making all those changes at once was the best solution I found.

@henriquemoody henriquemoody force-pushed the core/only-paths branch 3 times, most recently from b57c21a to fc9bfc0 Compare March 27, 2025 10:22
@codecov

codecov Bot commented May 18, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.51%. Comparing base (c0b8baa) to head (137c74c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1532      +/-   ##
============================================
- Coverage     97.53%   97.51%   -0.03%     
- Complexity      966      982      +16     
============================================
  Files           199      203       +4     
  Lines          2153     2216      +63     
============================================
+ Hits           2100     2161      +61     
- Misses           53       55       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/feature/Issues/Issue1376Test.php Outdated
@henriquemoody henriquemoody force-pushed the core/only-paths branch 11 times, most recently from cab88fe to c20a53c Compare December 20, 2025 14:12
Comment thread library/Message/Formatter/NestedListStringFormatter.php Outdated
Comment thread library/Rules/Each.php Outdated
Comment thread library/Rules/Named.php
Comment thread tests/feature/Issues/Issue1376Test.php
@henriquemoody henriquemoody force-pushed the core/only-paths branch 3 times, most recently from 8782d9a to f828187 Compare December 20, 2025 20:20
@henriquemoody henriquemoody changed the title Trace paths instead of IDs Change how we trace the path of results Dec 20, 2025
@henriquemoody henriquemoody force-pushed the core/only-paths branch 3 times, most recently from c89b23e to 6a79a77 Compare December 20, 2025 21:16
@henriquemoody henriquemoody marked this pull request as ready for review December 20, 2025 21:16
Currently, we’re using scalar values to trace paths. The problem with
that approach is that we can’t create a reliable hierarchy with them, as
we can’t know for sure when a path is the same for different rules. By
using an object, we can easily compare and create a parent-child
relationship with it.

While making these changes, I deemed it necessary to also create objects
to handle Name and Id, which makes the code simpler and more robust. By
having Name and Path, we can create specific stringifiers that allow us
to customise how we render those values.

I didn’t manage to make those changes atomically, which is why this
commit makes so many changes. I found myself moving back and forth, and
making all those changes at once was the best solution I found.
Comment thread tests/feature/Issues/Issue179Test.php
@henriquemoody henriquemoody merged commit 137c74c into Respect:main Dec 21, 2025
5 checks passed
@henriquemoody henriquemoody deleted the core/only-paths branch December 21, 2025 10:07
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