Skip to content

Add phase concept to backend #42

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 26 commits into
base: main
Choose a base branch
from
Open

Add phase concept to backend #42

wants to merge 26 commits into from

Conversation

But2ene
Copy link
Contributor

@But2ene But2ene commented Mar 2, 2025

No description provided.

@But2ene But2ene requested a review from Gbury March 2, 2025 15:08
@But2ene But2ene self-assigned this Mar 2, 2025
@But2ene But2ene linked an issue Mar 2, 2025 that may be closed by this pull request
@Gbury
Copy link
Contributor

Gbury commented Mar 2, 2025

Could you try and just keep the relevant commit for this PR ? Currently the diff is quite hard to read because it includes the changes from #14 , and therefore it's really complex to see what the changes of this PR specifically are.

Copy link
Contributor

@Gbury Gbury left a comment

Choose a reason for hiding this comment

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

You need to resovle the conflicts in README since I merged #15

@But2ene But2ene closed this Mar 17, 2025
@But2ene But2ene reopened this Mar 17, 2025
@But2ene But2ene requested a review from Gbury March 17, 2025 22:56
@Gbury
Copy link
Contributor

Gbury commented Mar 22, 2025

You keep adding a lot of commits here (most of them unrelated to adding phases), which makes this pretty much impossible to review. For the future, it would be better to keep each PR constrained to what its title says, and open separate PRs for separate features/code additions (note that these PRs can depend on each other).

In particular, adding new concepts/changing the concepts we already agreed on (e.g. your recent commit about competitors) deserve a standalone PR to motivate the addition.

I've cherry-picked your changes to the lib to a PR that I'll open this weekend that aims to add all of the DB tables to the library (and remove the then-redundant db init script, following a comment from @MagicalLay on the db init script PR).

Copy link
Contributor Author

@But2ene But2ene left a comment

Choose a reason for hiding this comment

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

history rewrited, only phase added here

let judge_artefact_descr = Ftw.Artefact.Descr.of_string phase.judge_artefact_description in
let head_judge_artefact_descr = Ftw.Artefact.Descr.of_string phase.head_judge_artefact_description in
let ranking_algorithm = Ftw.Ranking.Algorithm.of_string phase.ranking_algorithm in
let updated_p = Ftw.Phase.build id_p competition_p round_p judge_artefact_descr
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than building a phase with its ids (which is very error-prone as one could build a phase with the wrong id very easily), I'd rather the update function have the same type as the create function with an additional argument for the id of the phase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used exactly the same args as create. Phase is identified by competition_id and phase_id.

[@@deriving yojson]
[@@deriving yojson, enum, show]

let all = List.filter_map of_enum (List.init (to_enum Jack_and_Jill + 1) Fun.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is simpler than the current code, particularly for such a simple and small type...

@But2ene But2ene requested a review from Gbury April 4, 2025 23:35
@But2ene
Copy link
Contributor Author

But2ene commented Apr 4, 2025

tests are working now !

@But2ene
Copy link
Contributor Author

But2ene commented Apr 10, 2025

code repris par la PR #86

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.

Add phase concept to backend
2 participants