Skip to content

feat(ci): sync issue assignees from PR closing refs and handle /take comments - #4885

Merged
Yicong-Huang merged 9 commits into
apache:mainfrom
Yicong-Huang:feat/auto-triage-pr-link-and-take
May 4, 2026
Merged

Yicong-Huang merged 9 commits into
apache:mainfrom
Yicong-Huang:feat/auto-triage-pr-link-and-take

Conversation

@Yicong-Huang

@Yicong-Huang Yicong-Huang commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds three automation flows. By example (#N, #M are placeholders):

Example 1 — You open a PR with Closes #N in the body.
You are added as an assignee of issue #N, and #N's triage label is removed (downstream of the existing assigned-event handler). Other assignees of #N (e.g. a maintainer) are not touched.

Example 2 — You then edit the PR body to drop Closes #N.
You are removed from issue #N's assignees. If you were the only assignee, triage is added back. The detection uses changes.body.from plus a regex to find which closing references disappeared; closingIssuesReferences (GraphQL) only reflects the new state and is not enough on its own.

Example 3 — A contributor comments /take on issue #M.
The commenter is auto-assigned and triage is removed. Exact-line match: /take this issue please does not trigger. /take from a [bot] account is filtered at the job level. /take posted on a PR (vs an issue) is filtered by issue.pull_request == null.

Example 4 — A maintainer merges a PR.
Behavior unchanged. The existing credit-issue-on-pr-merge step overwrites issue assignees with the credited authors set (PR opener + commit authors, deduped, max 10, [bot] filtered).

Example 5 — A bare issue is created (no template, e.g., via API or migration).
The triage label is added automatically. Issues created via the existing templates (which already attach labels: ["triage"]) are unaffected — the workflow no-ops when the label is already there. Issues opened with an assignee pre-set (e.g., creator self-assigns at creation) skip this step so the assigned-event handler does not immediately remove the just-added label.

auto-assign.yml is renamed to pr-assignment.yml (its scope now extends past pure PR self-assign). The 3 prior jobs are collapsed into 1 job with 3 step-level if-guards so the PR Checks UI shows one entry per PR event instead of 2-3 skipped siblings.

Any related issues, documentation, discussions?

Closes #4884

How was this PR tested?

Static YAML parse via python3 -c 'import yaml; yaml.safe_load(...)'. End-to-end behavior is verified post-merge via the example scenarios above (each scenario is the manual reproduction step).

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7)

…comments

Renames auto-assign.yml to pr-assignment-triage.yml to reflect its
expanded scope: in addition to PR self-assign and merge-time credit,
it now mirrors the PR opener as an assignee on each same-repo issue
listed in closingIssuesReferences and removes them when a closing
keyword is dropped from the PR body. Triggers expand to include
edited/reopened/ready_for_review, gated on PR open state and a
non-bot opener so closed-PR edits and bot PRs do not churn issue
state. Other manual assignees are never touched here, so this never
fights with credit-issue-on-pr-merge or human triage decisions.

Extends issue-triage.yml with a take-comment job that assigns the
author of a /take comment on an issue. The startsWith filter at
the job level keeps non-/take comments from allocating a runner;
exact-match validation inside the script rejects suffixes like
"/take this issue please". The triage label removal then falls
out of the existing assigned-event handler.

Closes apache#4884
@github-actions github-actions Bot added feature ci changes related to CI labels May 4, 2026
@codecov-commenter

codecov-commenter commented May 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.28%. Comparing base (7cd34b1) to head (6647c37).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4885      +/-   ##
============================================
+ Coverage     43.12%   43.28%   +0.15%     
- Complexity     2153     2218      +65     
============================================
  Files           914      985      +71     
  Lines         32196    37529    +5333     
  Branches       3253     4282    +1029     
============================================
+ Hits          13886    16243    +2357     
- Misses        17468    20122    +2654     
- Partials        842     1164     +322     
Flag Coverage Δ
access-control-service 28.12% <ø> (ø)
agent-service 33.49% <ø> (-0.24%) ⬇️
amber 42.99% <ø> (+0.16%) ⬆️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 32.40% <ø> (-0.85%) ⬇️
frontend 33.99% <ø> (+4.50%) ⬆️
python 87.03% <ø> (+0.02%) ⬆️
workflow-compiling-service 47.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ingle job

The opened event already covers draft creation (drafts are opened
PRs), and edited covers the body-change paths that ready_for_review
and reopened would otherwise re-trigger redundantly. Trim the trigger
list to opened/edited/closed.

Collapse the three separate jobs into one job with step-level if
guards. The PR Checks UI shows one job entry per workflow run rather
than two-or-three skipped siblings, matching the actual semantic of
"one PR triage cycle". Step-level skips remain visible in the run
log but no longer create separate Check entries on the PR.

Trade-off: a closed-without-merge event now allocates a runner that
ends with all steps skipped (~10s of compute) instead of three
job-level skips. This is rare relative to the typical PR lifecycle,
and the cleaner UI on every other event outweighs it.
@Yicong-Huang Yicong-Huang changed the title feat(ci): sync issue assignees from PR closing refs and handle /take comments feat(ci): sync issue assignees from PR closing refs and handle /take comments May 4, 2026
@Yicong-Huang Yicong-Huang added the release/v1.1 back porting to release/v1.1 label May 4, 2026
@Yicong-Huang
Yicong-Huang enabled auto-merge (squash) May 4, 2026 02:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds/extends GitHub Actions automation to keep issue assignment + triage labeling in sync with PR closing references and /take issue comments.

Changes:

  • Replaces the old PR auto-assign workflow with a consolidated pr-assignment.yml that self-assigns PR authors, syncs PR openers to same-repo closing issues, and keeps the existing “credit assignees on merge” behavior.
  • Extends issue-triage.yml to (a) add triage on newly-opened unassigned issues and (b) implement /take comment self-assignment for issues.
  • Removes the legacy .github/workflows/auto-assign.yml workflow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/pr-assignment.yml New PR-target workflow that self-assigns PR authors, mirrors PR opener onto closing issues, and credits assignees on merge.
.github/workflows/issue-triage.yml Adds opened and issue_comment.created handling to manage triage label and /take self-assignment.
.github/workflows/auto-assign.yml Removes the prior workflow now superseded by pr-assignment.yml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/pr-assignment.yml Resolved
Comment thread .github/workflows/pr-assignment.yml Resolved
@Yicong-Huang
Yicong-Huang disabled auto-merge May 4, 2026 03:07
…ut-merge

Two review-driven fixes for the PR-assignment workflow:

1. The body-diff regex used to detect removed closing references now
   accepts the colon form ("Closes: apache#123") in addition to the bare
   "closes apache#123" form. The behavior on multiple refs per line
   ("Closes #1, #2") is unchanged and matches `closingIssuesReferences`
   semantics — only #1 is treated as a closing ref. Verified against 12
   shape variants (uppercase/colon/multi-line/non-keyword).

2. New step: when a PR is closed without being merged, remove the opener
   from each same-repo closing-reference issue. Previously, abandoned
   PRs left the opener as a stale assignee with `triage` removed. The
   issue-triage workflow's unassigned handler then re-adds `triage` if
   no other assignees remain. Cross-repo refs are skipped, consistent
   with the assign side. Bot-opened PRs are excluded.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@Yicong-Huang
Yicong-Huang enabled auto-merge (squash) May 4, 2026 03:15
@Yicong-Huang
Yicong-Huang merged commit b16d0db into apache:main May 4, 2026
38 checks passed
@Yicong-Huang
Yicong-Huang deleted the feat/auto-triage-pr-link-and-take branch May 4, 2026 03:31
Yicong-Huang added a commit that referenced this pull request May 4, 2026
…` comments (#4885)

### What changes were proposed in this PR?

Adds three automation flows. By example (`#N`, `#M` are placeholders):

**Example 1 — You open a PR with `Closes #N` in the body.**
You are added as an assignee of issue `#N`, and `#N`'s `triage` label is
removed (downstream of the existing assigned-event handler). Other
assignees of `#N` (e.g. a maintainer) are not touched.

**Example 2 — You then edit the PR body to drop `Closes #N`.**
You are removed from issue `#N`'s assignees. If you were the only
assignee, `triage` is added back. The detection uses `changes.body.from`
plus a regex to find which closing references disappeared;
`closingIssuesReferences` (GraphQL) only reflects the new state and is
not enough on its own.

**Example 3 — A contributor comments `/take` on issue `#M`.**
The commenter is auto-assigned and `triage` is removed. Exact-line
match: `/take this issue please` does not trigger. `/take` from a
`[bot]` account is filtered at the job level. `/take` posted on a PR (vs
an issue) is filtered by `issue.pull_request == null`.

**Example 4 — A maintainer merges a PR.**
Behavior unchanged. The existing `credit-issue-on-pr-merge` step
overwrites issue assignees with the credited authors set (PR opener +
commit authors, deduped, max 10, `[bot]` filtered).

**Example 5 — A bare issue is created (no template, e.g., via API or
migration).**
The `triage` label is added automatically. Issues created via the
existing templates (which already attach `labels: ["triage"]`) are
unaffected — the workflow no-ops when the label is already there. Issues
opened with an assignee pre-set (e.g., creator self-assigns at creation)
skip this step so the assigned-event handler does not immediately remove
the just-added label.

`auto-assign.yml` is renamed to `pr-assignment.yml` (its scope now
extends past pure PR self-assign). The 3 prior jobs are collapsed into 1
job with 3 step-level if-guards so the PR Checks UI shows one entry per
PR event instead of 2-3 skipped siblings.

### Any related issues, documentation, discussions?

Closes #4884

### How was this PR tested?

Static YAML parse via `python3 -c 'import yaml; yaml.safe_load(...)'`.
End-to-end behavior is verified post-merge via the example scenarios
above (each scenario is the manual reproduction step).

### Was this PR authored or co-authored using generative AI tooling?

(backported from commit b16d0db)

Generated-by: Claude Code (Opus 4.7)
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Backport to release/v1.1.0-incubating succeeded as e03b299. Run

yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
…` comments (apache#4885)

### What changes were proposed in this PR?

Adds three automation flows. By example (`#N`, `#M` are placeholders):

**Example 1 — You open a PR with `Closes #N` in the body.**
You are added as an assignee of issue `#N`, and `#N`'s `triage` label is
removed (downstream of the existing assigned-event handler). Other
assignees of `#N` (e.g. a maintainer) are not touched.

**Example 2 — You then edit the PR body to drop `Closes #N`.**
You are removed from issue `#N`'s assignees. If you were the only
assignee, `triage` is added back. The detection uses `changes.body.from`
plus a regex to find which closing references disappeared;
`closingIssuesReferences` (GraphQL) only reflects the new state and is
not enough on its own.

**Example 3 — A contributor comments `/take` on issue `#M`.**
The commenter is auto-assigned and `triage` is removed. Exact-line
match: `/take this issue please` does not trigger. `/take` from a
`[bot]` account is filtered at the job level. `/take` posted on a PR (vs
an issue) is filtered by `issue.pull_request == null`.

**Example 4 — A maintainer merges a PR.**
Behavior unchanged. The existing `credit-issue-on-pr-merge` step
overwrites issue assignees with the credited authors set (PR opener +
commit authors, deduped, max 10, `[bot]` filtered).

**Example 5 — A bare issue is created (no template, e.g., via API or
migration).**
The `triage` label is added automatically. Issues created via the
existing templates (which already attach `labels: ["triage"]`) are
unaffected — the workflow no-ops when the label is already there. Issues
opened with an assignee pre-set (e.g., creator self-assigns at creation)
skip this step so the assigned-event handler does not immediately remove
the just-added label.

`auto-assign.yml` is renamed to `pr-assignment.yml` (its scope now
extends past pure PR self-assign). The 3 prior jobs are collapsed into 1
job with 3 step-level if-guards so the PR Checks UI shows one entry per
PR event instead of 2-3 skipped siblings.

### Any related issues, documentation, discussions?

Closes apache#4884

### How was this PR tested?

Static YAML parse via `python3 -c 'import yaml; yaml.safe_load(...)'`.
End-to-end behavior is verified post-merge via the example scenarios
above (each scenario is the manual reproduction step).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 25, 2026
)

### What changes were proposed in this PR?

Remove unused imports, bindings, helpers and fields, and settings that
repeat a default or another entry, from the Amber Python runtime, the
Python test resources of the workflow compiler and operators, the `bin/`
licensing, local-dev and observability scripts, repository
configuration, and three GitHub workflows (**+102/-172 lines**). There
is no behavior change.

- **Amber Python runtime:** `StatisticsManager` uses `defaultdict`
instead of the deprecated `typing.DefaultDict`, and
`BroadcastPartitioner` builds its batch with `[]`.
`LargeBinaryOutputStream` raises and documents `OSError` (which
`IOError` aliases), wraps its best-effort cleanup delete in
`contextlib.suppress`, and drops the `pass` after `flush`'s docstring.
- **Operator verification test resources:** `py_op_driver.py` drops ten
`pytexera` imports and `RAW_TYPE_MAPPING` that it never reads. User code
runs in its own namespace seeded by `from pytexera import *`, so the
"used dynamically" note on those imports did not hold. `compare.py`
drops the uncalled `_string_columns` helper and two dict copies of
`double_kinds_a`/`double_kinds_e`, and `hf_parse_probe.py` drops unused
`io` and `re` imports. Quoted annotations, `open(..., "r")`,
`startswith` plus a slice, and a placeholder-free f-string take their
plain forms here and in `standalone_worker.py`, `py_compile_worker.py`
and `hf_binary_value_probe.py`.
- **`bin/` scripts:** the licensing tools use a tuple `startswith`, read
the one regex group they need instead of unpacking all four, print plain
strings where f-strings had no placeholders, return a `bool` expression
directly, drop annotation quotes under `from __future__ import
annotations`, use `removesuffix`, and name unused loop values `_`. Two
licensing tests drop `# noqa: E402` comments that suppress nothing under
Ruff, and `test_local_dev_tui.py` drops the never-passed `version`
parameter of `_seed_jvm_layout` together with the docstring sentence
about a jar it never wrote. `bin/observability/smoke_test.py` stops
returning an unread status from `_post`, builds the trace id from one
`uuid4().hex` (the first 32 hex digits of two concatenated ones were
always the first), and drops a `leaked = False` that both branches of
the following `try` overwrite.
- **Repository configuration:** `amber/pyproject.toml` drops
`line-length = 88` and `max-complexity = 10`, which are Ruff's defaults
(and `C901` is not selected). `.dockerignore` drops a root
`user-resources/` entry that its first rule, `**/user-resources/`,
already covers. `bin/fix-format.sh` drops the `""` case that
`TARGET="${1:-all}"` makes unreachable, and `bin/frontend-proto-gen.sh`
drops a `--proto_path` that repeats its `-I`.
`bin/k8s/templates/aws/.gitkeep` goes, since the folder holds
`s3-credentials-secret.yaml`. `bin/y-websocket-server/package.json`
drops npm-init's `main` and placeholder `test` script (the image runs
`npx y-websocket`), and a `bin/observability/docker-compose.yml` comment
stops pointing at a `start_app.sh` that the repository does not have.
- **GitHub workflows:** `comment-commands.yml` drops `github.event_name
== 'issue_comment' && github.event.action == 'created'` from three job
conditions, because the workflow only runs on `issue_comment:
[created]`. `pr-assignment.yml` drops a `|| ''` that follows a `typeof
... === 'string'` guard. `benchmarks-pr-comment.yml` stops storing
per-benchmark commit and date, a sample count and delta labels that
nothing reads, takes each row's status from the deltas it already
computed instead of a second `deltaInfo` pass, reuses each metric's
7-day delta, and builds the PR-only CSV table only when there is no
comparison to show.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Amber Python runtime: apache#1891 (2023-05-01), apache#3262
(2025-02-18), apache#4100 (2025-12-15), apache#4707 (2026-05-03), apache#5249
(2026-06-06), apache#8260 (2026-11-18); test resources: apache#7207 (2026-08-14),
apache#8617 (2026-10-15), apache#9306 (2026-11-10), apache#8357 (2026-11-17), apache#8358
(2026-11-18), apache#8359 (2026-11-19); `bin/` scripts: apache#4387 (2026-04-29),
apache#4668 (2026-05-02), apache#4693 (2026-05-02), apache#4711 (2026-05-03), apache#5057
(2026-05-15), apache#5417 (2026-06-10), apache#5961 (2026-06-28), apache#5377
(2026-10-28); configuration: apache#3019 (2024-11-20), apache#3335 (2025-03-23),
apache#3441 (2025-05-19), apache#3890 (2025-10-14), apache#4005 (2025-10-29), apache#4105
(2025-12-05), apache#5757 (2026-06-24); workflows: apache#4885 (2026-05-03), apache#4986
(2026-05-08), apache#5148 (2026-05-22), apache#5557 (2026-06-11), apache#5639 (2026-06-12)
|
| Usage removed by | `issue_comment` checks: apache#4899 (2026-05-04, `ci:
drop the triage label, use is:open no:assignee filter`) moved `/take`
out of `issue-triage.yml`, which also ran on `issues` events, into a
workflow that only runs on created comments, and apache#4986 and apache#5148 copied
the checks into two new jobs; `aws/.gitkeep`: apache#5932 (2026-07-01,
`feat(k8s): make app-tier object storage configurable via storage.s3`)
added the folder's first template; PR-only CSV table: apache#5639 (2026-06-12,
`ci: compare benchmark PRs with main`) shows it only when there is no
comparison; everything else: unused or redundant since introduction |

As of 2026-11-23, the unread test-resource code is under a week old, the
`.gitkeep` placeholder and the unread benchmark fields have been
redundant for about 5 months, the `issue_comment` checks for over 6
months, and the duplicate `.dockerignore` entry and `--proto_path` for
20 and 24 months.

### Any related issues, documentation, discussions?

Closes apache#9676.

### How was this PR tested?

Ran on `525f8ce3fb` and on `main` at `89a492f97e` (Windows 11, Python
3.12 with CI's pinned `ruff` 0.14.7, `pytest` 9.0.3 and `textual` 8.2.8,
JDK 17):

```bash
cd amber
ruff check src/main/python src/test/python
ruff format --check src/main/python src/test/python
pytest -m "not integration"
cd ..
ruff check $(git diff --name-only origin/main -- '*.py' ':!amber/')
python -m pytest bin/ -v --tb=short
sbt "WorkflowCompilingService/testOnly org.apache.texera.amber.translator.verify.ComparatorSpec org.apache.texera.amber.translator.verify.HarnessSpec org.apache.texera.amber.translator.verify.PyOpExecHarnessSpec org.apache.texera.amber.translator.verify.VisualizationJsonComparatorSpec"
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceBinaryValueBehaviorSpec org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceParseBehaviorSpec org.apache.texera.amber.util.PythonCodeRawInvalidTextSpec"
```

- Ruff: passed on `amber/` (218 files already formatted) and on the 14
changed Python files outside `amber/`.
- `pytest -m "not integration"` in `amber/` (JUnit XML): each of the
1,524 tests has the same outcome as on `main`: 1,496 passed, 10 skipped,
and the same 18 platform-dependent tests (Iceberg catalog on PostgreSQL
and `s3fs`, time zones, object reprs) fail on this Windows machine on
both.
- `python -m pytest bin/` (JUnit XML): each of the 196 tests has the
same outcome as on `main`: 186 passed, and nine `bin/mounter` tests plus
`test_stamp_dir_for_matches_shell_sha1`, which assume POSIX paths and
shells, fail on Windows on both.
- sbt (JUnit XML, `UDF_PYTHON_PATH` set to Python 3.12 because Windows
has no `python3`): these seven suites load the edited test resources.
`WorkflowCompilingService` passed 52 of 52 in 4 suites and
`WorkflowOperator` 11 of 11 in 3 suites, with 0 canceled, the same as on
`main`.
- Licensing scripts: `concat_license_binary.py` writes byte-identical
combined licenses for the Python and frontend images, and
`check_binary_deps.py jar` prints byte-identical reports and exit codes
for a synthetic lib folder with missing, extra and version-mismatched
jars, with and without `--ignore-transitive-version`.
- Workflows: the three edited workflows run only from the default branch
(`issue_comment`, `pull_request_target` and `workflow_run`), so this
PR's CI cannot run them. Each edited `github-script` body ran before and
after under Node with recording stubs for `github`, `core`, `fs` and
`fetch`, over 496 fixtures (missing or malformed CSV and baseline data,
failed API calls, body edits with and without closing references). Every
API call, comment body and log line is identical, and a one-line change
to each script does show up in its traces. The `comment-commands.yml`
conditions differ from `main` only by the two removed checks.
- `bash -n` passes on `bin/fix-format.sh` and
`bin/frontend-proto-gen.sh`, and the edited YAML, TOML and JSON files
parse.
- After review, `f84888ca6c` changes only three docstrings in
`large_binary_output_stream.py` and inlines one local in
`py_op_driver.py`. On it, Ruff passes as above, each of the 1,524
`amber` tests again has the same outcome as on `main`, the four
`WorkflowCompilingService` suites pass 52 of 52, and `_jsonify` returns
the same strings as on `525f8ce3fb` for seven `BINARY` inputs, with and
without the pickle marker.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI feature release/v1.1 back porting to release/v1.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-triage: sync issue assignees from PR closing references and handle /take comments

4 participants