From ca950a12634f60398457aedb43e947963c3d4b3e Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 8 Aug 2025 09:52:53 +0200 Subject: [PATCH 1/4] Add an automatic tagger --- .github/workflows/tagger.yml | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/tagger.yml diff --git a/.github/workflows/tagger.yml b/.github/workflows/tagger.yml new file mode 100644 index 000000000..08eb37f47 --- /dev/null +++ b/.github/workflows/tagger.yml @@ -0,0 +1,53 @@ +name: PR Tagger + +on: + pull_request: + types: [opened, synchronize] + +permissions: + pull-requests: write + +jobs: + tag-pr: + runs-on: ubuntu-latest + steps: + - name: Add tags based on changed files + uses: actions/github-script@v6 + with: + script: | + const tag_map = { + 'src/torchjd/_autogram/': 'package: autogram', + 'src/torchjd/_autojac/': 'package: autojac', + 'src/torchjd/aggregation/': 'package: aggregation', + '.github/workflows/': 'CI', + 'docs/': 'docs', + 'tests/': 'test' + }; + + const tags_to_add = new Set(); + + const files = await github.rest.pulls.listFiles({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number, + }); + + for (const file of files.data) { + for (const package_dir in tag_map) { + if (file.filename.startsWith(package_dir)) { + tags_to_add.add(tag_map[package_dir]); + } + } + } + + if (tags_to_add.size > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: Array.from(tags_to_add) + }); + console.log(`Added tags: ${Array.from(tags_to_add).join(', ')}`); + } else { + console.log('No relevant files changed, no tags added.'); + } From e2338d1f65a67d1aaf61c329722378615170e9d8 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 8 Aug 2025 09:58:19 +0200 Subject: [PATCH 2/4] Add a change to the `aggregation` package to check update of tags, this is to be reverted --- src/torchjd/aggregation/_upgrad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torchjd/aggregation/_upgrad.py b/src/torchjd/aggregation/_upgrad.py index 96a3ccccd..397aa5a8e 100644 --- a/src/torchjd/aggregation/_upgrad.py +++ b/src/torchjd/aggregation/_upgrad.py @@ -53,7 +53,7 @@ def __init__( self._pref_vector = pref_vector self._norm_eps = norm_eps self._reg_eps = reg_eps - self._solver = solver + self._solver = solver + "test" super().__init__( _UPGradWrapper(weighting, norm_eps=norm_eps, reg_eps=reg_eps, solver=solver) From 7bf4a864cf78043bf9d069d153dfa6858d84e09f Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 8 Aug 2025 09:59:13 +0200 Subject: [PATCH 3/4] Revert "Add a change to the `aggregation` package to check update of tags, this is to be reverted" This reverts commit e2338d1f65a67d1aaf61c329722378615170e9d8. --- src/torchjd/aggregation/_upgrad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torchjd/aggregation/_upgrad.py b/src/torchjd/aggregation/_upgrad.py index 397aa5a8e..96a3ccccd 100644 --- a/src/torchjd/aggregation/_upgrad.py +++ b/src/torchjd/aggregation/_upgrad.py @@ -53,7 +53,7 @@ def __init__( self._pref_vector = pref_vector self._norm_eps = norm_eps self._reg_eps = reg_eps - self._solver = solver + "test" + self._solver = solver super().__init__( _UPGradWrapper(weighting, norm_eps=norm_eps, reg_eps=reg_eps, solver=solver) From 645db47dfd1c8bc334f649d52304aa0569e83eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= <31951177+ValerianRey@users.noreply.github.com> Date: Thu, 30 Oct 2025 05:46:32 +0100 Subject: [PATCH 4/4] Update .github/workflows/tagger.yml Co-authored-by: Pierre Quinton --- .github/workflows/tagger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tagger.yml b/.github/workflows/tagger.yml index 08eb37f47..64e068a72 100644 --- a/.github/workflows/tagger.yml +++ b/.github/workflows/tagger.yml @@ -19,7 +19,7 @@ jobs: 'src/torchjd/_autogram/': 'package: autogram', 'src/torchjd/_autojac/': 'package: autojac', 'src/torchjd/aggregation/': 'package: aggregation', - '.github/workflows/': 'CI', + '.github/workflows/': 'ci', 'docs/': 'docs', 'tests/': 'test' };