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

Champ related cleanups and refactoring #10711

Merged

Conversation

tchak
Copy link
Member

@tchak tchak commented Aug 22, 2024

No description provided.

@tchak tchak force-pushed the refactor-champ-related-cleanups branch from 21c621f to f342610 Compare August 22, 2024 16:02
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.58%. Comparing base (8ec2b38) to head (79c9784).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10711   +/-   ##
=======================================
  Coverage   84.58%   84.58%           
=======================================
  Files        1118     1118           
  Lines       24770    24753   -17     
  Branches     4609     4611    +2     
=======================================
- Hits        20952    20938   -14     
+ Misses       3818     3815    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tchak tchak force-pushed the refactor-champ-related-cleanups branch 3 times, most recently from 82bc57b to 94bd4de Compare August 26, 2024 10:18
app/models/champ.rb Outdated Show resolved Hide resolved
Comment on lines 90 to 98
champs_by_stable_id = dossier.revision.types_de_champ.index_by { "tdc#{_1.stable_id}" }

used_tags.filter_map do |used_tag|
corresponding_champ = champs_by_stable_id[used_tag]
corresponding_type_de_champ = champs_by_stable_id[used_tag]

if corresponding_champ && corresponding_champ.blank?
corresponding_champ
if corresponding_type_de_champ && dossier.project_champ(corresponding_type_de_champ, nil).blank?
corresponding_type_de_champ
end
end
Copy link
Contributor

@mfo mfo Aug 26, 2024

Choose a reason for hiding this comment

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

ça me chagrine ce changement, on renvoyait des champs, maintenant des types de champs. isolé dans ce seul commit, je crains que nous cassions un appel venant d'un appelant, je sais pas dire si le code appelant est testé ac ce cas, mais se serait top d'ajouter un test la dessus non (ou clarifier le nommage)

Copy link
Member Author

Choose a reason for hiding this comment

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

Il y a un seul usage de ce code dans l'app et on s'en sert seulement des méthodes libelle et private? sur les objets renvoyés

@tchak tchak force-pushed the refactor-champ-related-cleanups branch 2 times, most recently from 051ba86 to 79c9784 Compare August 26, 2024 13:03
@tchak tchak enabled auto-merge August 26, 2024 13:04
@tchak tchak added this pull request to the merge queue Aug 26, 2024
Merged via the queue into demarches-simplifiees:main with commit 7b4d1e4 Aug 26, 2024
18 checks passed
@tchak tchak deleted the refactor-champ-related-cleanups branch August 26, 2024 13:18
Copy link

sentry-io bot commented Aug 30, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_champs_on_doss... Champs::SiretController#show View Issue

Did you find this useful? React with a 👍 or 👎

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.

2 participants