File: InternalIssuesCreateMirror.yml

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (87 lines) | stat: -rw-r--r-- 4,712 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Create or Label Mirror Issue
on:
  issues:
    types:
      - labeled

env:
  GH_TOKEN: ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
  TITLE_PREFIX: "[duckdb/#${{ github.event.issue.number }}]"
  PUBLIC_ISSUE_TITLE: ${{ github.event.issue.title }}

jobs:
  handle_pr_submitted_or_fix_on_nightly_label:
    if: github.event.label.name == 'PR submitted' || github.event.label.name == 'fixed on nightly'
    runs-on: ubuntu-latest
    steps:
      - name: Remove 'needs triage' label
        run: |
          gh issue edit --repo duckdb/duckdb ${{ github.event.issue.number }} --remove-label "needs triage"

  add_needs_reproducible_example_comment:
    if: github.event.label.name == 'needs reproducible example'
    runs-on: ubuntu-latest
    steps:
      - name: Add comment
        run: |
          cat > needs-reproducible-example-comment.md << EOF
          Thanks for opening this issue in the DuckDB issue tracker! To resolve this issue, our team needs a reproducible example. This includes:

          * A source code snippet which reproduces the issue.
          * The snippet should be self-contained, i.e., it should contain all imports and should use relative paths instead of hard coded paths (please avoid \`/Users/JohnDoe/...\`).
          * A lot of issues can be reproduced with plain SQL code executed in the [DuckDB command line client](https://duckdb.org/docs/api/cli/overview). If you can provide such an example, it greatly simplifies the reproduction process and likely results in a faster fix.
          * If the script needs additional data, please share the data as a CSV, JSON, or Parquet file. Unfortunately, we cannot fix issues that can only be reproduced with a confidential data set. [Support contracts](https://duckdblabs.com/#support) allow sharing confidential data with the core DuckDB team under NDA.

          For more detailed guidelines on how to create reproducible examples, please visit Stack Overflow's [“Minimal, Reproducible Example”](https://stackoverflow.com/help/minimal-reproducible-example) page.
          EOF
          gh issue comment --repo duckdb/duckdb ${{ github.event.issue.number }} --body-file needs-reproducible-example-comment.md

  create_or_label_mirror_issue:
    if: github.event.label.name == 'reproduced' || github.event.label.name == 'under review'
    runs-on: ubuntu-latest
    steps:
      - name: Remove 'needs triage' / 'under review' if 'reproduced'
        if: github.event.label.name == 'reproduced'
        run: |
          gh issue edit --repo duckdb/duckdb ${{ github.event.issue.number }} --remove-label "needs triage" --remove-label "under review" --remove-label "needs reproducible example"

      - name: Remove 'needs triage' / 'reproduced' if 'under review'
        if: github.event.label.name == 'under review'
        run: |
          gh issue edit --repo duckdb/duckdb ${{ github.event.issue.number }} --remove-label "needs triage" --remove-label "reproduced"

      - name: Remove 'needs triage' if 'expected behavior'
        if: github.event.label.name == 'expected behavior'
        run: |
          gh issue edit --repo duckdb/duckdb ${{ github.event.issue.number }} --remove-label "needs triage"

      - name: Get mirror issue number
        run: |
          gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --state all --jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
          echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV

      - name: Print whether mirror issue exists
        run: |
          if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
            echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
          else
            echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
          fi

      - name: Set label environment variable
        run: |
          if ${{ github.event.label.name == 'reproduced' }}; then
            echo "LABEL=reproduced" >> $GITHUB_ENV
            echo "UNLABEL=under review" >> $GITHUB_ENV
          else
            echo "LABEL=under review" >> $GITHUB_ENV
            echo "UNLABEL=reproduced" >> $GITHUB_ENV
          fi

      - name: Create or label issue
        run: |
          if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
            gh issue create --repo duckdblabs/duckdb-internal --label "$LABEL" --title "$TITLE_PREFIX - $PUBLIC_ISSUE_TITLE" --body "See https://github.com/duckdb/duckdb/issues/${{ github.event.issue.number }}"
          else
            gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --remove-label "$UNLABEL" --add-label "$LABEL"
          fi