Copilot commented on code in PR #5419:
URL: https://github.com/apache/texera/pull/5419#discussion_r3368604914


##########
.github/workflows/stale.yml:
##########
@@ -0,0 +1,73 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Auto-close stale pull requests after a total of 90 days of inactivity
+# (60 days to mark stale, +30 days to close). Issues are not touched.
+#
+# Escape hatches (any one keeps a PR alive):
+#   - Add the `pinned` label
+#   - Attach a milestone
+#   - Keep the PR in draft state
+#   - Push a commit, comment, or address review feedback
+
+name: Close stale pull requests
+
+on:
+  schedule:
+    - cron: '0 1 * * 1'   # weekly, Monday 01:00 UTC
+  workflow_dispatch:
+
+permissions:
+  pull-requests: write
+

Review Comment:
   `actions/stale` uses the Issues API to add/remove labels and to close PRs; 
with only `pull-requests: write` the workflow may fail to label/comment/close 
PRs due to insufficient token permissions. Grant `issues: write` as well 
(matches other workflows here that manage PRs via labels/comments).



##########
.github/workflows/stale.yml:
##########
@@ -0,0 +1,73 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Auto-close stale pull requests after a total of 90 days of inactivity
+# (60 days to mark stale, +30 days to close). Issues are not touched.
+#
+# Escape hatches (any one keeps a PR alive):
+#   - Add the `pinned` label
+#   - Attach a milestone
+#   - Keep the PR in draft state
+#   - Push a commit, comment, or address review feedback
+
+name: Close stale pull requests
+
+on:
+  schedule:
+    - cron: '0 1 * * 1'   # weekly, Monday 01:00 UTC
+  workflow_dispatch:
+

Review Comment:
   This workflow only runs on `schedule` / `workflow_dispatch`, so a PR that 
becomes active again (push/comment/review) will not have the `stale` label 
removed until the next scheduled/manual run. That does not match the PR 
description / issue requirement that a stale PR “un-stales automatically on the 
next push, comment, or review action”. Consider either (a) adding event 
triggers (e.g., `pull_request_target` + `issue_comment` + review events) with a 
lightweight job that removes the `stale` label for the single PR that triggered 
the event, while gating `actions/stale` to only run on schedule/dispatch, or 
(b) updating the stated behavior/requirements to reflect the scheduled cleanup 
behavior.



##########
.github/workflows/stale.yml:
##########
@@ -0,0 +1,73 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Auto-close stale pull requests after a total of 90 days of inactivity
+# (60 days to mark stale, +30 days to close). Issues are not touched.
+#
+# Escape hatches (any one keeps a PR alive):
+#   - Add the `pinned` label
+#   - Attach a milestone
+#   - Keep the PR in draft state
+#   - Push a commit, comment, or address review feedback
+
+name: Close stale pull requests
+
+on:
+  schedule:
+    - cron: '0 1 * * 1'   # weekly, Monday 01:00 UTC
+  workflow_dispatch:
+
+permissions:
+  pull-requests: write
+
+jobs:
+  stale:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/stale@v9
+        with:
+          # Issues: disabled entirely.
+          days-before-issue-stale: -1
+          days-before-issue-close: -1
+
+          # PRs: 60 days inactive -> stale, +30 days -> close.
+          days-before-pr-stale: 60
+          days-before-pr-close: 30
+          stale-pr-label: 'stale'
+          exempt-pr-labels: 'pinned'
+          exempt-all-pr-milestones: true
+          exempt-draft-pr: true

Review Comment:
   `actions/stale` does not create repository labels automatically. If `stale` 
(and `pinned` for exemption) do not already exist, the run will error when 
attempting to apply them. Add an explicit note here so maintainers create both 
labels before the first scheduled run.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to