Skip to content

Add ProFormA validity checks and disable exporting not invalid #2054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kkoehn
Copy link
Contributor

@kkoehn kkoehn commented Jun 30, 2025

this adds rudimentary ProFormA validation. In the show view exporting gets disabled when the export is not possible. For that the export service is called (twice) whenever the show view gets rendered. I'm not sure about the performance impact of that.

@kkoehn kkoehn self-assigned this Jun 30, 2025
@kkoehn kkoehn linked an issue Jun 30, 2025 that may be closed by this pull request
@kkoehn kkoehn force-pushed the 1888-align-proforma-validations-with-task-model branch from fac8f4e to 097234e Compare June 30, 2025 18:40
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.75%. Comparing base (f572823) to head (29ff76d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2054      +/-   ##
==========================================
+ Coverage   94.74%   94.75%   +0.01%     
==========================================
  Files         133      133              
  Lines        3404     3412       +8     
==========================================
+ Hits         3225     3233       +8     
  Misses        179      179              

☔ 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.

@kkoehn kkoehn marked this pull request as ready for review June 30, 2025 19:12
@@ -45,6 +45,7 @@ def show
@files = @task.files
@tests = @task.tests
@model_solutions = @task.model_solutions
@proforma_valid = [nil, *ProformaXML::SCHEMA_VERSIONS].index_with {|v| @task.proforma_valid?(schema_version: v) }

Choose a reason for hiding this comment

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

It wasn't easy for me to figure this out. The nil case is the default case? It will be one of the versions listed in ProformaXML::SCHEMA_VERSIONS (the default version). The rest of the versions are used to enable the downloads for the specific versions?

I think this hash is a bit difficult to understand. Maybe we can create a new object like ProformaTaskValidation with the task as an input. This object to then do the validation you added to the model and integrate the check for each version. 🤔

@kkoehn kkoehn force-pushed the 1888-align-proforma-validations-with-task-model branch from 097234e to 29ff76d Compare July 9, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align ProFormA validations with task model
2 participants