Commit graph

13915 commits

Author SHA1 Message Date
Pierre de La Morinerie
4efc1053f9 specs: make dossiers deletion specs more robust
It would fail when ran on some dates, like "21 Dec. 2021".
2021-12-21 17:20:32 +01:00
Pierre de La Morinerie
7478268b11
Merge pull request #6752 from tchak/fix-delete-procedures 2021-12-16 18:32:47 +01:00
Paul Chavard
e264472481 fix(procedures): fix check to enable procedure delete 2021-12-16 17:28:42 +00:00
krichtof
038572e422
Merge pull request #6755 from betagouv/update-zones-to-proc
Ajoute une tâche manuelle pour renseigner la zone des procédures données en entrée
2021-12-16 17:24:36 +01:00
Christophe Robillard
822c754581 add namespace for populate_zones task 2021-12-16 17:20:06 +01:00
Christophe Robillard
882f92268c update zone to procedures 2021-12-16 17:20:06 +01:00
LeSim
818e0472dd
[API Particulier] (4/4) Support du statut étudiant (#6754)
[API Particulier] (4/4) Support du statut étudiant
2021-12-16 16:49:44 +01:00
François Vantomme
14e0c68266 feat(api particulier): add MESRI field 2021-12-16 16:45:18 +01:00
François Vantomme
f08081abfe fix(api particulier): remove $def key from pole emploi JSON schema 2021-12-16 16:45:18 +01:00
François Vantomme
115adbec70 style(api particulier): harmonize pole emploi resource name constant 2021-12-16 16:45:17 +01:00
François Vantomme
3d81d4b541 feat(api particulier): add MESRI adapter 2021-12-16 16:45:17 +01:00
François Vantomme
5097e78b45 feat(api particulier): add MESRI locales 2021-12-16 16:45:17 +01:00
François Vantomme
66a9109cd7 feat(api particulier): add MESRI support to sources service 2021-12-16 16:45:17 +01:00
François Vantomme
693a95904e style(api particulier): mentionne le statut étudiant dans les locales 2021-12-16 16:45:16 +01:00
mfo
f6bcc48f6e
Merge pull request #6756 from betagouv/fix-date_trunc-queries
Revert "refactor date_trunc queries using groupdate gem"
2021-12-16 15:19:55 +01:00
Martin
b9d13df483 fix(spec): avoid flacky test. 15.days ago is not always on the previous month. eg: this spec failed on 16 of december, stats is still in december 2021-12-16 15:02:17 +01:00
krichtof
e5bf318178
Merge pull request #6749 from betagouv/zonage
rend le zonage disponible derrière le feature flag _zonage_
groupe les options lors de la séléction de la zone
2021-12-15 19:43:41 +01:00
Christophe Robillard
c9c1f206b9 fix zone acronyms 2021-12-15 19:37:32 +01:00
Christophe Robillard
84c648eef0 manual task for populating zones 2021-12-15 19:37:32 +01:00
Christophe Robillard
dec1f787a7 edit zone only if zonage feature enabled 2021-12-15 19:37:32 +01:00
Christophe Robillard
829d644c10 group related options in zone select box 2021-12-15 19:37:32 +01:00
Paul Chavard
99665d8119
Merge pull request #6753 from betagouv/fix_potential_fishing
Corrige un affichage non nettoyé d'email d'un usager
2021-12-15 16:20:04 +01:00
simon lehericey
c7f7855f14 avoid phishing 2021-12-15 13:51:49 +01:00
simon lehericey
0e7a6f5acf remove obsolete route 2021-12-15 13:43:32 +01:00
Pierre de La Morinerie
282642c36f
Merge pull request #6748 from betagouv/better-stats-text 2021-12-14 15:07:26 +01:00
Pierre de La Morinerie
be1ddb59ec views: localize the stats partial
Also rename 'procédure' to 'démarches'.
2021-12-14 15:03:22 +01:00
LeSim
4f80ab6374
Merge pull request #6747 from betagouv/US/fix-flacky-spec
wip - works from time to time (rspec ./spec/services/procedure_archive_service_spec.rb:181)
2021-12-14 14:29:11 +01:00
Martin
5ad0ee8ca9 fix(spec.flacky): try to use extractor in a more conventional way to extract file content 2021-12-14 14:18:59 +01:00
Pierre de La Morinerie
075c42e11e
Merge pull request #6737 from govpf/feature/fix_time_zoned_queries 2021-12-14 08:58:02 +01:00
maatinito
0a31c8bc79 refactor date_trunc queries using groupdate gem 2021-12-14 08:50:11 +01:00
maatinito
573b3d39e2 Fix date_trunc sql queries for timezoned forks 2021-12-14 08:50:09 +01:00
mfo
776f531804
Merge pull request #6735 from betagouv/zip_using_zip
Zip using zip
2021-12-13 17:50:29 +01:00
Martin
cf5794eebf clean(brakeman): remove unwanted warning 2021-12-13 17:09:20 +01:00
Martin
721d926c0d wip(fix): chdir 2021-12-13 16:37:04 +01:00
mfo
148be50c86 Update app/services/procedure_archive_service.rb
Co-authored-by: LeSim <mail@simon.lehericey.net>
2021-12-13 16:37:04 +01:00
Martin
1795084dce fix(brakeman): no code injection here 2021-12-13 16:37:04 +01:00
Martin
f7bc387e44 feat(flipper): use new way of generating archive only on some procedure flipped with new actor :zip_using_binary 2021-12-13 16:37:04 +01:00
simon lehericey
f0b0e7fd9a Switch to usage of zip unix binary to create archive. Also use a dedicated queue for DelayedJob
use dedicated archives queue

As the used disk space will increase, we want a fined grain control

move zip logic in dedicated method

zip

wip

wip

fix(spec): pass spec in green

tech(improvements): avoid File.delete(folder), favor FileUtils.remove_entry_secure which is safer. Also wrap most of code that open file within blocks so it is cleaned when the block ends. Lastly use  attachement.download to avoid big memory pressure [download in chunk, write in chunk] otherwise big file [124>1GO] are loaded in memory. what if we run multiple jobs/download in parallel ?

fix(spec): try to retry with grace

clean(procedure_archive_service_spec.rb): better retry [avoid to rewrite on open file]

lint(things): everything
2021-12-13 16:37:04 +01:00
mfo
68a0b6f474
Merge pull request #6746 from betagouv/US/fix_mon_avis_validator
ETQ administrateur ; je souhaite pouvoir publier un lien vers monavis qui utilise les URL de vosusagers
2021-12-13 15:48:53 +01:00
Martin
4b2e858a1a fix(mon_avis_embed_validator): enhance regexp 2021-12-13 14:49:40 +01:00
LeSim
6cdb694a14
Répare le fichier csv des stats accessible en super admin 2021-12-10 16:52:02 +01:00
maatinito
9df0d98109 Fix csv download of stats
https://medium.com/@mitsun.chieh/activerecord-relation-with-raw-sql-argument-returns-a-warning-exception-raising-8999f1b9898a
2021-12-10 16:48:11 +01:00
Paul Chavard
58adcf14e4
Merge pull request #6741 from tchak/fix-bulk_messages_groupe_instructeurs
fix(bulk_messages): destroy bulk messages with procedures
2021-12-09 16:20:43 +01:00
Paul Chavard
c7b1dc7f87 fix(bulk_messages): destroy bulk messages with procedures 2021-12-09 16:16:40 +01:00
Paul Chavard
78784d1c62
Merge pull request #6740 from betagouv/fix-instructeur-daily-notifications
Correction de la requête de notification quotidienne des Instructeurs
2021-12-09 12:21:56 +01:00
Pierre de La Morinerie
0e35bc609d notifications: don't preload dossiers on instructeurs
This request currently times out almost every night in production.

It's because although Instructeurs are loaded in batches (default batch
size is 1000), loading all dossiers for 1000 instructeurs is slow.

Turns out the code executed after this query to compute notifications
doesn't even use these dossiers. Indeed it is faster not to preload
them: both the initial query and the total treatment time are shorter.

Here's a quick benchmark made locally (but using production data):

- Before this commit:

	Benchmark.measure { pp Instructeur.includes(assign_to: { procedure: :dossiers }).where(assign_tos: { daily_email_notifications_enabled: true }).limit(100).m
ap(&:email_notification_data) }

Only the initial query : 35s
Total time : 97s

- Without preloading dossiers:

	Benchmark.measure { pp Instructeur.includes(assign_to: :procedure).where(assign_tos: { daily_email_notifications_enabled: true }).limit(100).m
ap(&:email_notification_data) }

Only the initial query : 0.08s (400x faster)
Total time : 29s (3,3x faster)

Plus it doesn't timeout, of course.
2021-12-09 12:10:00 +01:00
Paul Chavard
0a96e2f5a0
Merge pull request #6739 from tchak/feat-helpscout-tags
feat(helpscout): add a tag to messages submited through contact form
2021-12-09 12:00:40 +01:00
Paul Chavard
b67818e425 feat(helpscout): add a tag to messages submited through contact form 2021-12-09 11:47:13 +01:00
Paul Chavard
a0ce6fa388
Merge pull request #6738 from tchak/fix-graphql-nil-attestation
fix(graphql): do not crash if attestation is nil
2021-12-08 13:24:18 +01:00
Paul Chavard
efd8ddb99e fix(graphql): do not crash if attestation is nil 2021-12-08 13:12:42 +01:00