From 6a00164139bfdf420bbd82e4533f9ee2f52ff628 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:40:28 -0300 Subject: [PATCH 01/23] Create main.yml --- .github/workflows/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..5230a4557 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,18 @@ +on: + pull_request: + types: [opened] + +jobs: + apply-label: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + script: | + console.log(${{ steps.pr-files.outputs.changedFiles }}) + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['Triage'] + }) From 57f20a6f49a48c28a0b75e60b0971782c5bf79af Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:43:10 -0300 Subject: [PATCH 02/23] testing --- packages/mix/CHANGELOG.md | 2 +- packages/mix_generator/lib/mix_generator.dart | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/mix/CHANGELOG.md b/packages/mix/CHANGELOG.md index 032788fc3..5022d78cb 100644 --- a/packages/mix/CHANGELOG.md +++ b/packages/mix/CHANGELOG.md @@ -3,7 +3,7 @@ - Improved merge behavior between ShapeDecoration and BoxDecoration - Fixed space token resolve on gap in flex attribute - Added remaining params to callable specs and modifiers - + ## 1.1.2 - Chore: Changed the class modifier of the Spec class for code generation. diff --git a/packages/mix_generator/lib/mix_generator.dart b/packages/mix_generator/lib/mix_generator.dart index 84ccaea79..e3d4dfae0 100644 --- a/packages/mix_generator/lib/mix_generator.dart +++ b/packages/mix_generator/lib/mix_generator.dart @@ -17,7 +17,10 @@ Builder dtoDefinition(BuilderOptions options) => SharedPartBuilder( allowSyntaxErrors: true, ); -Builder classUtilityDefinition(BuilderOptions options) => SharedPartBuilder( +Builder classUtilityDefinition( + BuilderOptions options, +) => + SharedPartBuilder( [MixableClassUtilityGenerator()], 'class_utility', allowSyntaxErrors: true, From bef57d64da7dcb6a393ecebb745088a590e470dd Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:44:47 -0300 Subject: [PATCH 03/23] change --- .github/workflows/{main.yml => add_label.yml} | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) rename .github/workflows/{main.yml => add_label.yml} (80%) diff --git a/.github/workflows/main.yml b/.github/workflows/add_label.yml similarity index 80% rename from .github/workflows/main.yml rename to .github/workflows/add_label.yml index 5230a4557..0be603723 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/add_label.yml @@ -1,6 +1,10 @@ on: - pull_request: - types: [opened] + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened jobs: apply-label: From 9c26b5f2aea8842214eb24bd30f19971f9b6a88e Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:48:22 -0300 Subject: [PATCH 04/23] Update add_label.yml --- .github/workflows/add_label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 0be603723..22596d88e 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -10,10 +10,10 @@ jobs: apply-label: runs-on: ubuntu-latest steps: + - run: echo ${{ steps.pr-files.outputs.changedFiles }} - uses: actions/github-script@v7 with: script: | - console.log(${{ steps.pr-files.outputs.changedFiles }}) github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, From e8c33cf78577910a338be56450a66d4f885ea77f Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:49:07 -0300 Subject: [PATCH 05/23] Update add_label.yml --- .github/workflows/add_label.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 22596d88e..4c09bb026 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -1,3 +1,5 @@ +name: "Add labels" + on: pull_request_target: types: From e7ef1eecc7106fdd97e7935381fe1f83a76de720 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:52:43 -0300 Subject: [PATCH 06/23] Update add_label.yml --- .github/workflows/add_label.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 4c09bb026..dac34a03f 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -8,6 +8,9 @@ on: - synchronize - reopened +permissions: + pull-requests: read + jobs: apply-label: runs-on: ubuntu-latest From 94277ea7d7da318188ae5822a6bb8f5b970acf0b Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:56:50 -0300 Subject: [PATCH 07/23] Update add_label.yml --- .github/workflows/add_label.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index dac34a03f..9c1089709 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -1,12 +1,7 @@ name: "Add labels" on: - pull_request_target: - types: - - opened - - edited - - synchronize - - reopened + pull_request: permissions: pull-requests: read @@ -15,7 +10,6 @@ jobs: apply-label: runs-on: ubuntu-latest steps: - - run: echo ${{ steps.pr-files.outputs.changedFiles }} - uses: actions/github-script@v7 with: script: | @@ -23,5 +17,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: ['Triage'] + labels: ${{ steps.pr-files.outputs.changedFiles }} }) From dc82e92e484f2471692a43a615cb678fafec64ee Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:58:05 -0300 Subject: [PATCH 08/23] Update add_label.yml --- .github/workflows/add_label.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 9c1089709..88fb7c1ce 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -13,9 +13,10 @@ jobs: - uses: actions/github-script@v7 with: script: | + console.log(steps.pr-files.outputs.changedFiles) github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: ${{ steps.pr-files.outputs.changedFiles }} + labels: ['Triage'] }) From c7543b81a0f0ab38e59cf209cc4608f020d55606 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:59:36 -0300 Subject: [PATCH 09/23] Update add_label.yml --- .github/workflows/add_label.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 88fb7c1ce..7b1a50924 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -13,7 +13,9 @@ jobs: - uses: actions/github-script@v7 with: script: | - console.log(steps.pr-files.outputs.changedFiles) + const files = context.payload.pull_request.files + console.log(`Modified files on this PR: ${files.map(f => f.filename).join(', ')}`) + github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, From cd911bf1b36d34144217113c8f5e94e4f039f852 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:01:58 -0300 Subject: [PATCH 10/23] Update add_label.yml --- .github/workflows/add_label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 7b1a50924..2db59b712 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -14,7 +14,7 @@ jobs: with: script: | const files = context.payload.pull_request.files - console.log(`Modified files on this PR: ${files.map(f => f.filename).join(', ')}`) + console.log(`Modified files on this PR: ${files}`) github.rest.issues.addLabels({ issue_number: context.issue.number, From d7042eb6deae7df1095bee01e92883d19f7a9899 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:03:16 -0300 Subject: [PATCH 11/23] Update add_label.yml --- .github/workflows/add_label.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 2db59b712..48791253d 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -16,9 +16,3 @@ jobs: const files = context.payload.pull_request.files console.log(`Modified files on this PR: ${files}`) - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['Triage'] - }) From 8b91fac7c9282be65b19538834a5d07594d56e2f Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:05:19 -0300 Subject: [PATCH 12/23] Update add_label.yml --- .github/workflows/add_label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 48791253d..8469d4505 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -13,6 +13,6 @@ jobs: - uses: actions/github-script@v7 with: script: | - const files = context.payload.pull_request.files + const files = context.payload.pull_request console.log(`Modified files on this PR: ${files}`) From 2c6c776f7b7dd734299cc66d07b5d343ec01347f Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:09:54 -0300 Subject: [PATCH 13/23] Update add_label.yml --- .github/workflows/add_label.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 8469d4505..ac5fb599b 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -13,6 +13,10 @@ jobs: - uses: actions/github-script@v7 with: script: | - const files = context.payload.pull_request - console.log(`Modified files on this PR: ${files}`) + const { execSync } = require('child_process') + const { commits } = context.payload.pull_request + const rawFiles = execSync(`git diff --name-only HEAD HEAD~${commits}`).toString() + const files = rawFiles.split('\n').filter(Boolean) + + console.log(files) From 7c569963e2771ffb48f604b0a02b772fdf795cb9 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:10:47 -0300 Subject: [PATCH 14/23] Update add_label.yml --- .github/workflows/add_label.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index ac5fb599b..72a7e27ef 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -10,7 +10,11 @@ jobs: apply-label: runs-on: ubuntu-latest steps: - - uses: actions/github-script@v7 + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - uses: actions/github-script@v6 with: script: | const { execSync } = require('child_process') From 1855d364fb41ee7dfb3901196b5cc60030b259db Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:15:28 -0300 Subject: [PATCH 15/23] Update add_label.yml --- .github/workflows/add_label.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 72a7e27ef..54dd3b267 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -14,7 +14,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: script: | const { execSync } = require('child_process') @@ -24,3 +24,8 @@ jobs: console.log(files) + const packagesFiles = files.filter(file => file.startsWith('packages/')) + const packages = packagesFiles.map(file => file.split('/')[1]) + const uniquePackages = new Set(packages) + console.log(uniquePackages) + From 8635582d3fc903dafb8f0fe46bfd8d42009775d4 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:20:33 -0300 Subject: [PATCH 16/23] Update add_label.yml --- .github/workflows/add_label.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 54dd3b267..b3730145a 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -22,10 +22,17 @@ jobs: const rawFiles = execSync(`git diff --name-only HEAD HEAD~${commits}`).toString() const files = rawFiles.split('\n').filter(Boolean) - console.log(files) + const ignoredPackage = 'mix_lint_test' - const packagesFiles = files.filter(file => file.startsWith('packages/')) + const packagesFiles = files.filter(file => file.startsWith('packages/') && !file.includes('ignoredPackages')) const packages = packagesFiles.map(file => file.split('/')[1]) const uniquePackages = new Set(packages) console.log(uniquePackages) + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: uniquePackages + }) + From 5021bc06c7a02ea934b3e5950d2a57990bc45de8 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:21:44 -0300 Subject: [PATCH 17/23] Update add_label.yml --- .github/workflows/add_label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index b3730145a..de67f5919 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -33,6 +33,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: uniquePackages + labels: Array.from(uniquePackages) }) From d1ca5e45aad102c525e63ba0676c936070808c3d Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:22:34 -0300 Subject: [PATCH 18/23] Update add_label.yml --- .github/workflows/add_label.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index de67f5919..859b3fc0e 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -27,12 +27,12 @@ jobs: const packagesFiles = files.filter(file => file.startsWith('packages/') && !file.includes('ignoredPackages')) const packages = packagesFiles.map(file => file.split('/')[1]) const uniquePackages = new Set(packages) - console.log(uniquePackages) + console.log(Array.from(uniquePackages)) github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: Array.from(uniquePackages) + labels: ['triage'] }) From e77a4600aab1987ac14b001ad961f5cad05bb26a Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:24:03 -0300 Subject: [PATCH 19/23] Update add_label.yml --- .github/workflows/add_label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 859b3fc0e..f65c9e23d 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -4,7 +4,7 @@ on: pull_request: permissions: - pull-requests: read + pull-requests: write jobs: apply-label: From 62e600e2b1c56194453d66b1d27cfb65931d2097 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:24:42 -0300 Subject: [PATCH 20/23] Update add_label.yml --- .github/workflows/add_label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index f65c9e23d..e226e7cf6 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -33,6 +33,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: ['triage'] + labels: Array.from(uniquePackages) }) From ab71cb39981b4f44066a51344efe73ae090c539e Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:26:45 -0300 Subject: [PATCH 21/23] Update add_label.yml --- .github/workflows/add_label.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index e226e7cf6..abf4ba8a7 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -27,12 +27,12 @@ jobs: const packagesFiles = files.filter(file => file.startsWith('packages/') && !file.includes('ignoredPackages')) const packages = packagesFiles.map(file => file.split('/')[1]) const uniquePackages = new Set(packages) - console.log(Array.from(uniquePackages)) + const labels = Array.from(uniquePackages) github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: Array.from(uniquePackages) + labels: labels }) From 7cfb664a775a81f33c7532474fba44a0167c57ab Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:35:51 -0300 Subject: [PATCH 22/23] Update add_label.yml --- .github/workflows/add_label.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index abf4ba8a7..c44535ccd 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -22,12 +22,22 @@ jobs: const rawFiles = execSync(`git diff --name-only HEAD HEAD~${commits}`).toString() const files = rawFiles.split('\n').filter(Boolean) - const ignoredPackage = 'mix_lint_test' - - const packagesFiles = files.filter(file => file.startsWith('packages/') && !file.includes('ignoredPackages')) + // verify packages + const packagesFiles = files.filter(file => file.startsWith('packages/') && !file.includes('mix_lint_test')) const packages = packagesFiles.map(file => file.split('/')[1]) - const uniquePackages = new Set(packages) - const labels = Array.from(uniquePackages) + const labels = Array.from(new Set(packages)) + + // verify documentation + const packagesFiles = files.filter(file => file.startsWith('website/')) + labels.push('documentation') + + // verify documentation + const packagesFiles = files.filter(file => file.startsWith('examples/')) + labels.push('examples') + + // verify documentation + const packagesFiles = files.filter(file => !file.startsWith('website/') && !file.startsWith('packages/') && file.startsWith('!file.startsWith('examples/')')) + labels.push('repo') github.rest.issues.addLabels({ issue_number: context.issue.number, From 38cedf1b06e3741d168c7334c30c0260b050d4ec Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:37:26 -0300 Subject: [PATCH 23/23] Update add_label.yml --- .github/workflows/add_label.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index c44535ccd..69954587a 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -45,4 +45,5 @@ jobs: repo: context.repo.repo, labels: labels }) +