From acaae6356dcb9aa87e9d566de50e3fbf3d3befb2 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 15 Feb 2024 12:16:22 +0100 Subject: [PATCH 1/2] Fix crash running `yarn flags --sort flag` --- scripts/flags/flags.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/flags/flags.js b/scripts/flags/flags.js index 8d1c903e14282..2b4fced638ff6 100644 --- a/scripts/flags/flags.js +++ b/scripts/flags/flags.js @@ -318,11 +318,15 @@ for (const flag of allFlagsUniqueFlags) { let sorted = table; if (isDiff || argv.sort) { const sortChannel = argToHeader(isDiff ? argv.diff[0] : argv.sort); - sorted = Object.fromEntries( - Object.entries(table).sort(([, rowA], [, rowB]) => - rowB[sortChannel].toString().localeCompare(rowA[sortChannel]) - ) - ); + const sortBy = + sortChannel === 'flag' + ? ([flagA], [flagB]) => { + return flagA.localeCompare(flagB); + } + : ([, rowA], [, rowB]) => { + return rowB[sortChannel].toString().localeCompare(rowA[sortChannel]); + }; + sorted = Object.fromEntries(Object.entries(table).sort(sortBy)); } if (argv.csv) { From 42aaf752e7f9564263fbbbc95ecada1bd379f942 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 15 Feb 2024 12:20:13 +0100 Subject: [PATCH 2/2] Run `yarn flags` in CI --- .circleci/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a0197b4134cd0..5a2a05126ec17 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,6 +97,16 @@ jobs: - setup_node_modules - run: node ./scripts/tasks/flow-ci + + yarn_flags: + docker: *docker + environment: *environment + + steps: + - checkout + - setup_node_modules + - run: yarn flags + scrape_warning_messages: docker: *docker environment: *environment @@ -400,6 +410,11 @@ workflows: build_and_test: unless: << pipeline.parameters.prerelease_commit_sha >> jobs: + - yarn_flags: + filters: + branches: + ignore: + - builds/facebook-www - yarn_flow: filters: branches: