Skip to content

Conversation

douglasduteil
Copy link
Contributor

@douglasduteil douglasduteil commented Oct 10, 2025


Replaces manual dependency tracking with automated daily workflow that:

  • Monitors annuaire-entreprises-data-gouv-fr/search-infra for new commits
  • Fetches updated data files from specific commit hash
  • Creates PRs automatically when updates are detected

Key improvements:

  • Removed peerDependencies pollution (now uses data/.commit file)
  • Replaced degit with clean TypeScript fetch script
  • Removed unused dependencies (degit, npm-run-all2)
  • Ensures data files stay in sync with tracked commit hash

Like #1483 we down grade the data on purpose to ensure a update PR is created after merge

@douglasduteil douglasduteil force-pushed the douglasduteil/automate-annuaire-entreprises-data-updates-via-daily-cron branch from 7080a21 to c0e89a4 Compare October 10, 2025 11:27
@douglasduteil douglasduteil force-pushed the douglasduteil/automate-annuaire-entreprises-data-updates-via-daily-cron branch from c0e89a4 to 34516de Compare October 10, 2025 11:27
Remove unused directory creation and adjust TypeScript config to properly include scripts folder without restricting rootDir. The data directory is created by the workflow before running the script.
This commit reverts follows #1483 with a own graded on purpuse to ensure that a pr will be created after merge
Add data change verification step before creating pull requests.
Previously, the workflow would create a PR whenever the search-infra
commit SHA changed, even if the generated data files remained identical.

The workflow now performs a two-stage check:
1. Commit SHA difference check (rebuilds data if different)
2. Data file change check (only creates PR if JSON files actually changed)

This prevents creating unnecessary PRs when upstream changes don't
affect the generated data.
@douglasduteil
Copy link
Contributor Author

douglasduteil commented Oct 10, 2025

What we want https://github.com/proconnect-gouv/proconnect-identite/actions/runs/18406028355/job/52446043186?pr=1488

 packages/annuaire_entreprises/data/.commit                            | 2 +-
 .../annuaire_entreprises/data/administration_siren_whitelist.json     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/packages/annuaire_entreprises/data/.commit b/packages/annuaire_entreprises/data/.commit
index 959b040..295a11d 100644
--- a/packages/annuaire_entreprises/data/.commit
+++ b/packages/annuaire_entreprises/data/.commit
@@ -1 +1 @@
-3c339c4f4e0367eddb24c827667d7db64623f43d
+6b9943789c70f18dcf970dedbea139ac9886fe28
diff --git a/packages/annuaire_entreprises/data/administration_siren_whitelist.json b/packages/annuaire_entreprises/data/administration_siren_whitelist.json
index d662660..04f85df 100644
--- a/packages/annuaire_entreprises/data/administration_siren_whitelist.json
+++ b/packages/annuaire_entreprises/data/administration_siren_whitelist.json
@@ -134,5 +134,7 @@
   "180020026": "CAISSE DES DEPOTS ET CONSIGNATIONS (CDC)",
   "334654035": "MAISONS & CITES SOCIETE ANONYME D'HLM (M & C)",
   "264600115": "HOPITAL DE SAINT CERE - SAINT-CERE",
-  "180000010": "GRANDE CHANCELLERIE DE LA LEGION D'HONNEUR"
+  "180000010": "GRANDE CHANCELLERIE DE LA LEGION D'HONNEUR",
+  "263500126": "CENTRE HOSPITALIER INTERCOMMUNAL REDON-CARENTOIR",
+  "439988767": "PAVI EVOLUTION (LE MAJESTIC)"
 }

Remove workflow_dispatch dry_run input parameter since dry run mode is automatically determined by PR context. This streamlines the workflow configuration while maintaining the same functionality.
"build": "tsc --build tsconfig.lib.json",
"prebuild:data": "rm -rf data",
"build:data": "run-p build:degit:*",
"prebuild:data": "npx --yes del-cli data/*.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: rm -rf should be enought here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure any more lol.
Will it work on your machine ?

@douglasduteil douglasduteil merged commit c8a39c9 into main Oct 10, 2025
45 checks passed
@douglasduteil douglasduteil deleted the douglasduteil/automate-annuaire-entreprises-data-updates-via-daily-cron branch October 10, 2025 12:58
@douglasduteil
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants