Skip to content

Override default scope for Workshop#2515

Merged
olleolleolle merged 1 commit intomasterfrom
fix-events-not-showing
Mar 10, 2026
Merged

Override default scope for Workshop#2515
olleolleolle merged 1 commit intomasterfrom
fix-events-not-showing

Conversation

@jonodrew
Copy link
Contributor

@jonodrew jonodrew commented Mar 9, 2026

The default_scope for Workshop sorts events in descending order. For future events, we want them sorted in ascending order (ie soonest first). Because I don't know why this scope was added, and where else it's used, I'm not going to change it. Instead, I've updated the two 'upcoming' scopes to override the default ordering.

I tested this by generating 15 Workshops for various times over the next two weeks. Without this fix, the workshops were the 5 furthest from this point in time. With this fix, they were the 5 soonest.

The default_scope for Workshop sorts events in descending order. For future events, we want them sorted in ascending order (ie soonest first). Because I don't know why this scope was added, and where else it's used, I'm not going to change it. Instead, I've updated the two 'upcoming' scopes to override the default ordering.

I tested this by generating 15 Workshops for various times over the next two weeks. Without this fix, the workshops were the 5 furthest from this point in time. With this fix, they were the 5 soonest.

Signed-off-by: jonathan.kerr <3410350+jonodrew@users.noreply.github.com>
@jonodrew jonodrew requested a review from KimberleyCook March 9, 2026 16:10
@jonodrew jonodrew marked this pull request as draft March 9, 2026 16:30
@jonodrew
Copy link
Contributor Author

jonodrew commented Mar 9, 2026

Tests are all passing locally for me, so will rerun the failing set

@jonodrew jonodrew marked this pull request as ready for review March 9, 2026 16:51
Copy link

@octoberclub octoberclub left a comment

Choose a reason for hiding this comment

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

Default scopes can trip you up! Seems like a simple fix so approved it.

Copy link
Collaborator

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Ah, default_scope (ow, the Old Wound!).

@olleolleolle olleolleolle merged commit acda8b9 into master Mar 10, 2026
22 of 23 checks passed
@olleolleolle olleolleolle deleted the fix-events-not-showing branch March 10, 2026 07:56
mroderick added a commit to mroderick/codebar-planner that referenced this pull request Mar 10, 2026
Add tests to verify that today_and_upcoming and upcoming scopes
return workshops in ascending order (soonest first), overriding
the Workshop default_scope which orders in descending order.

This ensures the fix in PR codebar#2515 is properly covered by tests.
olleolleolle added a commit that referenced this pull request Mar 10, 2026
test: Add tests for upcoming scope ordering fix (PR #2515)
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