Skip to content

feat: Report email with LIT authorization path#3011

Merged
arkirchner merged 3 commits into
mainfrom
ak/course_link_for_reports
Jul 11, 2025
Merged

feat: Report email with LIT authorization path#3011
arkirchner merged 3 commits into
mainfrom
ak/course_link_for_reports

Conversation

@arkirchner

@arkirchner arkirchner commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

To act on spam reports the teacher needs to sign in through the
course to authenticate in the study group. The LTI return URL is used
to link back to the course.

Relates to #2715

@arkirchner arkirchner self-assigned this Jul 9, 2025
@arkirchner
arkirchner force-pushed the ak/course_link_for_reports branch from e615a29 to 0c33eef Compare July 9, 2025 15:36
@arkirchner
arkirchner marked this pull request as ready for review July 9, 2025 15:37
@codecov

codecov Bot commented Jul 9, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.06%. Comparing base (dc156e4) to head (3edf9cf).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3011      +/-   ##
==========================================
+ Coverage   70.05%   70.06%   +0.01%     
==========================================
  Files         215      215              
  Lines        6846     6849       +3     
==========================================
+ Hits         4796     4799       +3     
  Misses       2050     2050              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arkirchner
arkirchner marked this pull request as draft July 9, 2025 16:33
@arkirchner
arkirchner marked this pull request as ready for review July 10, 2025 09:24
@Janis4411

Copy link
Copy Markdown
Contributor

I'm not very familiar with CodeOcean, but the changes make sense to me.

@MrSerth MrSerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As far as I understood the changes, the config setting is global. However, the URL is consumer-specific, which this setting doesn't reflect yet. Therefore, I would either use the "crazy" approach with the LTI params or add a new attribute to each consumer.

@arkirchner

Copy link
Copy Markdown
Contributor Author

@MrSerth I think since we practically only have open.hpi.de as a consumer currently, this temporary solution is good enough.

  • The LTI parameter association is has many and I can't tell what record to pick.
  • Adding a new parameter for the consumer increases the complexity unnecessarily.

I want to release this once and then see what kind of management we need. For the platform moderation, we should be able to moderate all user data without the LTI limitations on the study group.

@MrSerth

MrSerth commented Jul 10, 2025

Copy link
Copy Markdown
Member

There are other consumers configured on CodeOcean (e.g., including a staging consumer for openHPI), and this feature would be the first to break the multi-tenant approach. Of course, most traffic currently originates from openHPI production.

Regarding the LTI parameter, there should be only a single instance matching all search criteria. This is ensured by a validation we have in place:

validates :external_user_id, uniqueness: {scope: %i[study_group_id exercise_id]}

@arkirchner
arkirchner force-pushed the ak/course_link_for_reports branch from 3b2c628 to 5cfd765 Compare July 11, 2025 09:49
To act on spam reports the teacher needs to sign in through the
course to authenticate in the study group. The LTI return URL is used
to link back to the course.
@arkirchner
arkirchner force-pushed the ak/course_link_for_reports branch from 5cfd765 to 4134422 Compare July 11, 2025 09:52
@arkirchner arkirchner changed the title feat: Report email with LTI exercise path feat: Report email with LIT authorization path Jul 11, 2025
@arkirchner

Copy link
Copy Markdown
Contributor Author

@MrSerth I changed to the launch_presentation_return_url solution. I squashed and updated the description in the commit to reflect the change in the approach.

@MrSerth

MrSerth commented Jul 11, 2025

Copy link
Copy Markdown
Member

Thanks. I can confirm that the changes work as intended.

There is one implicit assumption made: The exercise URL is static and doesn't change on a per-user basis, since a random element is picked from the LTI parameters. For all use cases we currently have, this is valid, but it could potentially change in dynamic environments (or with the advanced content tree in openHPI and content A/B/n testing, where this assumption might not hold true). This would be circumvented by using the RfC author's LTI params (which, in an unlikely case, could be missing) or by adding a comment about this and changing it on demand in the future.

@arkirchner

Copy link
Copy Markdown
Contributor Author

Thank you for this information.

I think this is a solution for right now. In the future, we might need to consider a cleaner approach.

Can this be approved as is?

@MrSerth

MrSerth commented Jul 11, 2025

Copy link
Copy Markdown
Member

I acknowledge that the solution might be sufficient for now. To clarify our thoughts and persist them, I suggested adding a short comment:

or by adding a comment about this and changing it on demand in the future.

@arkirchner

Copy link
Copy Markdown
Contributor Author

I added a comment about the varying URL format.

@MrSerth

MrSerth commented Jul 11, 2025

Copy link
Copy Markdown
Member

Just to ensure there is no misunderstanding:

An hour ago, you wrote that you've added a comment (past tense), but I cannot see any differences in this PR, any other push activity in this repo, or within Slack/email. Since your previous post did not contain any other link or information on where to look for such a change, I am currently waiting patiently for further instructions. Please let me know if I am making a mistake and overlooking something obvious.

@arkirchner

Copy link
Copy Markdown
Contributor Author

I am very sorry I overlooked that the push failed.

@MrSerth MrSerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for pushing your changes, I just have a minor remark originally started by the spelling mistake.

Comment thread app/mailers/report_mailer.rb Outdated
Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
@arkirchner
arkirchner enabled auto-merge (squash) July 11, 2025 15:06
@arkirchner
arkirchner merged commit 111d5bb into main Jul 11, 2025
13 checks passed
@arkirchner
arkirchner deleted the ak/course_link_for_reports branch July 11, 2025 15:10
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