Skip to content

feat(member): include last finished summit sponsor memberships in getActiveSummitsSponsorMemberships#544

Merged
smarcet merged 1 commit into
mainfrom
feature/append-last-finished-summit-membership
May 13, 2026
Merged

feat(member): include last finished summit sponsor memberships in getActiveSummitsSponsorMemberships#544
smarcet merged 1 commit into
mainfrom
feature/append-last-finished-summit-membership

Conversation

@romanetar
Copy link
Copy Markdown
Collaborator

@romanetar romanetar commented May 13, 2026

ref https://app.clickup.com/t/86b9vzxfk

Summary by CodeRabbit

  • Bug Fixes
    • Sponsors now retain access to their permissions for the immediately preceding finished summit in addition to currently active summits, ensuring continuous access right after a summit concludes.

Review Change Stack

@romanetar romanetar requested a review from smarcet May 13, 2026 16:04
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@romanetar has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 25 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1dcd3758-b1c0-483b-a287-dcb3a342543d

📥 Commits

Reviewing files that changed from the base of the PR and between 2093df5 and ed12524.

📒 Files selected for processing (1)
  • app/Models/Foundation/Main/Member.php
📝 Walkthrough

Walkthrough

The PR modifies getActiveSummitsSponsorMemberships() to grant sponsor members access to both active summits and the most recently finished summit. A SQL UNION expands the sponsor ID selection to include the previous summit via a timestamped subquery, with documentation updated in-method to reflect this behavior.

Changes

Sponsor Access Retention After Summit Ends

Layer / File(s) Summary
Sponsor access query expansion with finished summit inclusion
app/Models/Foundation/Main/Member.php
The getActiveSummitsSponsorMemberships() method adds a comment documenting sponsor access to the preceding finished summit and refactors the native SQL query to use UNION with a subquery selecting sponsors from the most recently ended summit (via SummitEndDate < :now ordered descending with LIMIT 1), preserving existing JSON permission checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • smarcet

Poem

🐰 A sponsor's season now lingers long,
One more summit in their grasp,
As active streams and finished songs,
Unite in SQL's tight clasp!
Access flows like spring's sweet dawn. 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: extending getActiveSummitsSponsorMemberships to include last finished summit sponsor memberships.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/append-last-finished-summit-membership

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions
Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-544/

This page is automatically updated on each push to this PR.

Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/Models/Foundation/Main/Member.php`:
- Around line 1858-1864: The subquery picking a single s2.ID can drop a summit
when multiple rows share the same latest past SummitEndDate; change the filter
to include all summits with the maximum past SummitEndDate instead of one
arbitrary ID. Replace the scalar subquery "AND s.ID = (SELECT s2.ID ... ORDER BY
s2.SummitEndDate DESC LIMIT 1)" with a condition that compares s.SummitEndDate
to the MAX(SummitEndDate) for summits before :now (e.g. using "s.SummitEndDate =
(SELECT MAX(s3.SummitEndDate) FROM Summit s3 WHERE s3.SummitEndDate < :now)" or
by using IN with a subquery that selects all s2.ID where s2.SummitEndDate = that
MAX). Update the SQL in Member.php where s.ID and SummitEndDate are referenced
to return all tied latest finished summits so sponsor access isn't lost.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 369f404e-88aa-4a03-a0de-e5d6cb637bc5

📥 Commits

Reviewing files that changed from the base of the PR and between 7cf7fae and 2093df5.

📒 Files selected for processing (1)
  • app/Models/Foundation/Main/Member.php

Comment thread app/Models/Foundation/Main/Member.php Outdated
Comment on lines +1858 to +1864
AND s.ID = (
SELECT s2.ID
FROM Summit s2
WHERE s2.SummitEndDate < :now
ORDER BY s2.SummitEndDate DESC
LIMIT 1
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle ties for the latest finished summit.

This subquery picks a single Summit.ID, so if two summits share the same most recent past SummitEndDate, one is excluded arbitrarily. That drops sponsor access for one just-finished summit.

Suggested fix
-    AND s.ID = (
-        SELECT s2.ID
-        FROM Summit s2
-        WHERE s2.SummitEndDate < :now
-        ORDER BY s2.SummitEndDate DESC
-        LIMIT 1
-    )
+    AND s.SummitEndDate = (
+        SELECT MAX(s2.SummitEndDate)
+        FROM Summit s2
+        WHERE s2.SummitEndDate < :now
+    )
📝 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
AND s.ID = (
SELECT s2.ID
FROM Summit s2
WHERE s2.SummitEndDate < :now
ORDER BY s2.SummitEndDate DESC
LIMIT 1
)
AND s.SummitEndDate = (
SELECT MAX(s2.SummitEndDate)
FROM Summit s2
WHERE s2.SummitEndDate < :now
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/Models/Foundation/Main/Member.php` around lines 1858 - 1864, The subquery
picking a single s2.ID can drop a summit when multiple rows share the same
latest past SummitEndDate; change the filter to include all summits with the
maximum past SummitEndDate instead of one arbitrary ID. Replace the scalar
subquery "AND s.ID = (SELECT s2.ID ... ORDER BY s2.SummitEndDate DESC LIMIT 1)"
with a condition that compares s.SummitEndDate to the MAX(SummitEndDate) for
summits before :now (e.g. using "s.SummitEndDate = (SELECT MAX(s3.SummitEndDate)
FROM Summit s3 WHERE s3.SummitEndDate < :now)" or by using IN with a subquery
that selects all s2.ID where s2.SummitEndDate = that MAX). Update the SQL in
Member.php where s.ID and SummitEndDate are referenced to return all tied latest
finished summits so sponsor access isn't lost.

…ActiveSummitsSponsorMemberships

Signed-off-by: romanetar <roman_ag@hotmail.com>
@romanetar romanetar force-pushed the feature/append-last-finished-summit-membership branch from 2093df5 to ed12524 Compare May 13, 2026 16:56
@github-actions
Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-544/

This page is automatically updated on each push to this PR.

Copy link
Copy Markdown
Collaborator

@smarcet smarcet left a comment

Choose a reason for hiding this comment

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

LGTM

@smarcet smarcet merged commit ddf7a56 into main May 13, 2026
19 checks passed
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