Skip to content

Conversation

dnek
Copy link
Contributor

@dnek dnek commented Apr 21, 2021

Why is this change needed?

When problems are added to an existing contest, it would be useful to be able to skip the generation of the existing problems and generate only the new ones.
Related to #220.

What did you implement?

  • Add a config option: --skip-existing-problem for envgen

  • If the option is enabled, skip preparing each problem for which a directory already exists

  • Add test for --skip-existing-problem

    • Generate a contest once with --skip-existing-problem option
    • Modify a file in a directory for one problem and remove an entire directory for another problem
    • Generate the same contest again with --skip-existing-problem option
    • The modified file should remain as it is, the removed directory should be regenerated, and no backups should be generated

What behavior do you expect?

Refer to the test.

Copy link
Owner

@kyuridenamida kyuridenamida left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution & sophisticated PR description!

I put a few comments and I think it will get ready to be merged once they have resolved.

Can you take a look at those comments?

@kyuridenamida kyuridenamida changed the title Option to skip preparing existing problem New option to skip preparing existing problem directories Apr 22, 2021
@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2021

Codecov Report

❗ No coverage uploaded for pull request base (stable@abdc61a). Click here to learn what that means.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             stable     #222   +/-   ##
=========================================
  Coverage          ?   89.56%           
=========================================
  Files             ?       54           
  Lines             ?     2780           
  Branches          ?        0           
=========================================
  Hits              ?     2490           
  Misses            ?      290           
  Partials          ?        0           
Impacted Files Coverage Δ
atcodertools/config/config.py 100.00% <ø> (ø)
atcodertools/executils/run_program.py 83.33% <0.00%> (ø)
atcodertools/config/etc_config.py 100.00% <100.00%> (ø)
atcodertools/fmtprediction/models/calculator.py 93.51% <100.00%> (ø)
atcodertools/release_management/version.py 100.00% <100.00%> (ø)
atcodertools/tools/codegen.py 77.55% <100.00%> (ø)
atcodertools/tools/envgen.py 83.90% <100.00%> (ø)

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 abdc61a...f15b10a. Read the comment docs.

@dnek dnek requested a review from kyuridenamida April 22, 2021 01:15
@dnek
Copy link
Contributor Author

dnek commented Apr 22, 2021

I applied all your suggestions!
Please check again.

@kyuridenamida kyuridenamida removed their request for review April 22, 2021 11:04
Copy link
Owner

@kyuridenamida kyuridenamida left a comment

Choose a reason for hiding this comment

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

LGTM

@kyuridenamida kyuridenamida added this to the 2.2.0 milestone Apr 22, 2021
@kyuridenamida kyuridenamida merged commit 67215fe into kyuridenamida:stable Apr 22, 2021
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.

3 participants