Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support github issue forms for "Ticket" feature #1775

Merged
merged 4 commits into from
Apr 4, 2024
Merged

Conversation

petersutter
Copy link
Member

@petersutter petersutter commented Mar 27, 2024

What this PR does / why we need it:
Support github issue forms for the ticket feature. For more information on github issue forms, refer to the GitHub documentation

The table below outlines the properties nested under Values.global.dashboard.frontendConfig.ticket.newIssue in the gardener-dashboard Helm chart configuration:

Property Type Description Example
title string The title of the issue. If not defined, it will default to [${shootNamespace}/${shootName}]. title: "[${shootNamespace}/${shootName}] <problem>"
labels array Labels to be added to the issue. labels: ["bug", "urgent"]
template string The name of the issue template to use. template: "bug_report.md"
body string The body of the issue. This should not be set if you are using GitHub issue forms. body: "Steps to reproduce the issue..."
<form-element-id> string The ID of the form element. This can be pre-filled with the appropriate value. affectedCluster: "${shootUrl}"

Note: Any field under newIssue will be used as a query parameter when creating a new issue.

Available template variables:

  • ${shootName}: name of the shoot
  • ${shootNamespace}: namespace of the shoot
  • ${shootCreatedAt}: creation timestamp of the shoot, format 'YYYY-MM-DD'
  • ${shootUrl}: dashboard url of the shoot
  • ${providerType}: shoot provider type
  • ${region}: region of the shoot
  • ${machineImageNames}: comma separated list of (unique) machine image names from the shoot workers
  • ${projectName}: name of the project
  • ${utcDateTimeNow}: current date-time in utc format
  • ${seedName}: shoot's seed name
  • ${accessRestrictions}: list with shoot's selected access restrictions
    • accessRestrictions[].title: access restriction title
    • accessRestrictions[].description: access restriction description
    • accessRestrictions[].key: unique identifier
    • accessRestrictions[].options: list with selected options for the access restriction
      • accessRestrictions[].options[].title: option title
      • accessRestrictions[].options[].description: option description
      • accessRestrictions[].options[].key: unique identifier

Each value of a property under newIssue is treated as a template and the above-mentioned template variables will be applied during runtime.

Sample GitHub issue form:

name: "Sample Issue Form"
description: "Guided creation of an issue for a Shoot cluster"
title: "[<cluster>]: <problem> "
labels: ["topology/shoot"]
body:
  - type: markdown
    attributes:
      value: "# Gardener help center "
  - type: markdown
    attributes:
      value: |
        Please provide metadata and information for this issue, such as specifying which cluster is affected.
        By categorizing and prioritizing the issue appropriately, you can help us process this ticket more quickly.
  - type: input
    id: affectedCluster
    attributes:
      label: "Which cluster is affected?"
      description:  Please provide the link to your cluster in the Gardener Dashboard, so that we can identify it and run some self-diagnoses upfront.
    validations:
      required: true
  - type: textarea
    id: howToReproduce
    attributes:
      label: "How can we reproduce the issue (concisely and precisely)?"
      placeholder: |
        1. 
        2.
        3.
    validations:
      required: true

Example values of the gardener-dashboard Helm chart:

Create Ticket using GitHub issue forms

global:
  dashboard:
    frontendConfig:
      ticket:
        gitHubRepoUrl: https://foo-github.aaakk.us.kg/dummyorg/dummyrepo
        newIssue:
          fileName: shoot_issue.yaml
          affectedCluster: "${shootUrl}" # example template form element id

Create Ticket using regular GitHub issue:

global:
  dashboard:
    frontendConfig:
      ticket:
        gitHubRepoUrl: https://foo-github.aaakk.us.kg/dummyorg/dummyrepo
        newIssue:
          body: | # do not set `body`, if you use GitHub issue forms
            ## Which cluster is affected?

            `Cluster Details Dashboard Link`: [${projectName}/${shootName}](${shootUrl})
            ...

Which issue(s) this PR fixes:
Fixes #1638

Special notes for your reviewer:

Release note:

Changes have been made to two `gardener-dashboard` Helm chart values related to the ticket feature:
- The value previously at `Values.global.dashboard.frontendConfig.ticket.newTicketLabels` has been moved to `Values.global.dashboard.frontendConfig.ticket.newIssue.labels`.
- The value previously at `Values.global.dashboard.frontendConfig.ticket.issueDescriptionTemplate` has been moved to `Values.global.dashboard.frontendConfig.ticket.newIssue.body`.
GitHub issue forms are now supported when creating new tickets (GitHub issues) from the dashboard.
- Set `Values.global.dashboard.frontendConfig.ticket.newIssue.template` to specify the filename of the issue form template. For more information, refer to the [GitHub documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms)
- To pre-fill template form elements, specify the `id` of the form element under `Values.global.dashboard.frontendConfig.ticket.newIssue`. For instance, if you have a form element with `id` `affectedCluster`, you can pre-fill it like this: `Values.global.dashboard.frontendConfig.ticket.newIssue.affectedCluster="${shootUrl}"`. The template variable `shootUrl` will be replaced during runtime with the actual dashboard link of the shoot cluster.

@gardener-robot gardener-robot added the needs/review Needs review label Mar 27, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 27, 2024
@gardener-robot gardener-robot added the size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) label Mar 27, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 27, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 28, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 28, 2024
@gardener-robot
Copy link

@holgerkoser, @grolu You have pull request review open invite, please check

@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 4, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 4, 2024
Copy link
Contributor

@grolu grolu left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels Apr 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 4, 2024
Copy link
Member

@holgerkoser holgerkoser left a comment

Choose a reason for hiding this comment

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

/lgtm

@petersutter petersutter merged commit 98975ca into master Apr 4, 2024
9 checks passed
@petersutter petersutter deleted the enh/github-forms branch April 4, 2024 14:09
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Apr 4, 2024
@grolu grolu added the area/ipcei IPCEI (Important Project of Common European Interest) label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipcei IPCEI (Important Project of Common European Interest) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support GitHub issue forms with create ticket button
7 participants