Skip to content
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

Follow up to the fix to #1107 #1115

Merged
merged 4 commits into from
Feb 24, 2019

Conversation

stefano-maggiolo
Copy link
Member

@stefano-maggiolo stefano-maggiolo commented Feb 18, 2019

This transforms some include in macros, which is supposedly safer (as
they don't rely on state of the context, which is error prone). Also
fixes a small bug left from the previous fix.


This change is Reviewable

@codecov
Copy link

codecov bot commented Feb 18, 2019

Codecov Report

Merging #1115 into master will increase coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1115      +/-   ##
==========================================
+ Coverage      62%   62.17%   +0.16%     
==========================================
  Files         230      230              
  Lines       16591    16591              
==========================================
+ Hits        10287    10315      +28     
+ Misses       6304     6276      -28
Flag Coverage Δ
#functionaltests 45.97% <ø> (+0.22%) ⬆️
#unittests 43.25% <ø> (+0.01%) ⬆️
Impacted Files Coverage Δ
cms/server/contest/handlers/contest.py 87% <ø> (+3%) ⬆️
cms/db/fsobject.py 80.46% <0%> (-0.79%) ⬇️
cms/io/rpc.py 91.46% <0%> (-0.69%) ⬇️
cms/server/admin/handlers/base.py 68.47% <0%> (-0.68%) ⬇️
cms/io/service.py 68.9% <0%> (-0.61%) ⬇️
cms/service/workerpool.py 62.22% <0%> (-0.56%) ⬇️
cms/db/filecacher.py 78.03% <0%> (-0.33%) ⬇️
cms/io/PsycoGevent.py 68.57% <0%> (ø) ⬆️
cms/grading/Sandbox.py 68.23% <0%> (ø) ⬆️
cms/server/admin/handlers/dataset.py 25.69% <0%> (+0.92%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7be645b...5c7e91d. Read the comment docs.

Copy link
Member

@lw lw left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r1, 3 of 3 files at r2, 1 of 1 files at r3.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @stefano-maggiolo)


cms/server/contest/templates/task_submissions.html, line 290 at r2 (raw file):

<h2 style="margin: 40px 0 10px">{% trans %}Previous submissions{% endtrans %}</h2>

{% if can_use_tokens and actual_phase == 0 %}

Caution, this is not exactly equivalent: before the check passed when some task allowed tokens, now it passes if this task allows tokens. Maybe it's what we want (didn't check), but wanted to flag this.


cms/server/contest/templates/macro/submission.html, line 12 at r1 (raw file):

s_num (int): 1-based position of the submission in the list of
    submissions of the currently logged in participaiton on this task.
show_date (boolean): whether to display only the time or also the date.

s/boolean/bool/?


cms/server/contest/templates/macro/submission.html, line 11 at r2 (raw file):

submissions ([Submission]): all the submissions of the participation on this
    task.
can_use_tokens (boolean): whether tokens are allowed for this task.

s/boolean/bool/?


cms/server/contest/templates/macro/submission.html, line 72 at r3 (raw file):

    </thead>
    <tbody>
    {% set num_displayed = submissions|selectattr("official")|list|length if official else submissions|rejectattr("official")|list|length > 0 %}

Are you sure this works without parentheses? It's not the precedence order in Python:

In [1]: -1 if True else 1 > 0                                                   
Out[1]: -1

In [2]: -1 if False else 1 > 0                                                  
Out[2]: True

@stefano-maggiolo
Copy link
Member Author

Sorry for the push -f. I think I addressed the failure AND all of the things you pointed out. If you want to take a look let me know, otherwise I'll push to master soonish (e.g., tomorrow).

Copy link
Member

@lw lw left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 6 files at r5, 2 of 4 files at r6, 1 of 2 files at r7.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@stefano-maggiolo stefano-maggiolo merged commit 5c7e91d into cms-dev:master Feb 24, 2019
@stefano-maggiolo stefano-maggiolo deleted the fix1107bis branch February 25, 2019 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants