From 5832ed8f1573195a99dccb0603c7db644e3fe584 Mon Sep 17 00:00:00 2001 From: Shashank R Date: Fri, 8 May 2026 15:12:51 +0530 Subject: [PATCH 1/3] feat(csat): Add CSAT survey workflow --- .github/scripts/constant.js | 55 ++++++++++++++++++++++++++++ .github/scripts/csat.js | 71 +++++++++++++++++++++++++++++++++++++ .github/workflows/csat.yml | 21 +++++++++++ 3 files changed, 147 insertions(+) create mode 100644 .github/scripts/constant.js create mode 100644 .github/scripts/csat.js create mode 100644 .github/workflows/csat.yml diff --git a/.github/scripts/constant.js b/.github/scripts/constant.js new file mode 100644 index 0000000000..3e90cb8842 --- /dev/null +++ b/.github/scripts/constant.js @@ -0,0 +1,55 @@ +/* +Copyright 2026 Google LLC + +Licensed 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. +*/ + +let CONSTANT_VALUES = { + GLOBALS: { + LABELS: { + STALE: 'stale', + BUG: 'bug', + CORE: 'core', + TOOLS: 'tools', + SERVICES: 'services', + MODELS: 'models', + MCP: 'mcp', + AUTH: 'auth', + LIVE: 'live', + DOCUMENTATION: 'documentation', + GOOD_FIRST_ISSUE: 'good first issue', + AGENT_ENGINE: 'agent engine', + BQ: 'bq', + EVAL: 'eval', + TRACING: 'tracing', + WEB: 'web', + WORKFLOW: 'workflow', + REQUEST_CLARIFICATION: 'request clarification', + NEEDS_REVIEW: 'needs review' + }, + STATE: { CLOSED: 'closed' } + }, + MODULE: { + CSAT: { + YES: 'Yes', + NO: 'No', + BASE_URL: + 'https://docs.google.com/forms/d/e/1FAIpQLScgyeKPxUlq4kgNuI7g9_iXkQKlzT6ZvGA656x5HpbUpYjOsg/viewform?usp=pp_url&', + SATISFACTION_PARAM: 'entry.817493361=', + ISSUEID_PARAM: '&entry.1977942008=', + MSG: 'Are you satisfied with the resolution of your issue?', + } + } + +}; +module.exports = CONSTANT_VALUES; \ No newline at end of file diff --git a/.github/scripts/csat.js b/.github/scripts/csat.js new file mode 100644 index 0000000000..54356fd69d --- /dev/null +++ b/.github/scripts/csat.js @@ -0,0 +1,71 @@ +/* +Copyright 2026 Google LLC + +Licensed 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. +*/ +const CONSTANT_VALUES = require('./constant'); + +/** + * Invoked from stale_csat.js and csat.yaml file to post survey link + * in closed issue. + * @param {!Object.} github contains pre defined functions. + * context Information about the workflow run. + * @return {null} + */ +module.exports = async ({ github, context }) => { + const issue = context.payload.issue.html_url; + let baseUrl = ''; + // Loop over all ths label present in issue and check if specific label is + // present for survey link. + for (const label of context.payload.issue.labels) { + if (label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.BUG) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.CORE) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.TOOLS) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.SERVICES) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.MODELS) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.MCP) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.AUTH) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.LIVE) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.DOCUMENTATION) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.GOOD_FIRST_ISSUE) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.AGENT_ENGINE) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.BQ) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.EVAL) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.TRACING) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.WEB) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.WORKFLOW) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.REQUEST_CLARIFICATION) || + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.NEEDS_REVIEW)) { + console.log( + `label-${label.name}, posting CSAT survey for issue =${issue}`); + baseUrl = CONSTANT_VALUES.MODULE.CSAT.BASE_URL; + + const yesCsat = ` ${CONSTANT_VALUES.MODULE.CSAT.YES}`; + + const noCsat = ` ${CONSTANT_VALUES.MODULE.CSAT.NO}`; + const comment = CONSTANT_VALUES.MODULE.CSAT.MSG + '\n' + yesCsat + '\n' + + noCsat + '\n'; + let issueNumber = context.issue.number ?? context.payload.issue.number; + await github.rest.issues.createComment({ + issue_number: issueNumber, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); + } + } +}; diff --git a/.github/workflows/csat.yml b/.github/workflows/csat.yml new file mode 100644 index 0000000000..5da6ff909f --- /dev/null +++ b/.github/workflows/csat.yml @@ -0,0 +1,21 @@ +name: 'CSAT survey for ADK-Python' +on: + issues: + types: + - closed + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + welcome: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/github-script@v6 + with: + script: | + const script = require('./.github/scripts/csat.js') + script({github, context}) \ No newline at end of file From 5f36e46f11580ef7cf2ed3d3705545a9ccfa96c2 Mon Sep 17 00:00:00 2001 From: Shashank R Date: Mon, 11 May 2026 14:56:24 +0530 Subject: [PATCH 2/3] chore(csat): remove stale and request clarification labels --- .github/scripts/constant.js | 2 -- .github/scripts/csat.js | 1 - 2 files changed, 3 deletions(-) diff --git a/.github/scripts/constant.js b/.github/scripts/constant.js index 3e90cb8842..31ac16289e 100644 --- a/.github/scripts/constant.js +++ b/.github/scripts/constant.js @@ -17,7 +17,6 @@ limitations under the License. let CONSTANT_VALUES = { GLOBALS: { LABELS: { - STALE: 'stale', BUG: 'bug', CORE: 'core', TOOLS: 'tools', @@ -34,7 +33,6 @@ let CONSTANT_VALUES = { TRACING: 'tracing', WEB: 'web', WORKFLOW: 'workflow', - REQUEST_CLARIFICATION: 'request clarification', NEEDS_REVIEW: 'needs review' }, STATE: { CLOSED: 'closed' } diff --git a/.github/scripts/csat.js b/.github/scripts/csat.js index 54356fd69d..c69ac6591d 100644 --- a/.github/scripts/csat.js +++ b/.github/scripts/csat.js @@ -44,7 +44,6 @@ module.exports = async ({ github, context }) => { label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.TRACING) || label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.WEB) || label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.WORKFLOW) || - label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.REQUEST_CLARIFICATION) || label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.NEEDS_REVIEW)) { console.log( `label-${label.name}, posting CSAT survey for issue =${issue}`); From bc4fa8aeeb3070d738251e84b688d5748859bfae Mon Sep 17 00:00:00 2001 From: Shashank R Date: Mon, 11 May 2026 15:09:14 +0530 Subject: [PATCH 3/3] chore(csat): remove needs review label --- .github/scripts/constant.js | 3 +-- .github/scripts/csat.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/scripts/constant.js b/.github/scripts/constant.js index 31ac16289e..588a9c9337 100644 --- a/.github/scripts/constant.js +++ b/.github/scripts/constant.js @@ -32,8 +32,7 @@ let CONSTANT_VALUES = { EVAL: 'eval', TRACING: 'tracing', WEB: 'web', - WORKFLOW: 'workflow', - NEEDS_REVIEW: 'needs review' + WORKFLOW: 'workflow' }, STATE: { CLOSED: 'closed' } }, diff --git a/.github/scripts/csat.js b/.github/scripts/csat.js index c69ac6591d..6bea90e0f6 100644 --- a/.github/scripts/csat.js +++ b/.github/scripts/csat.js @@ -43,8 +43,7 @@ module.exports = async ({ github, context }) => { label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.EVAL) || label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.TRACING) || label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.WEB) || - label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.WORKFLOW) || - label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.NEEDS_REVIEW)) { + label.name.includes(CONSTANT_VALUES.GLOBALS.LABELS.WORKFLOW)) { console.log( `label-${label.name}, posting CSAT survey for issue =${issue}`); baseUrl = CONSTANT_VALUES.MODULE.CSAT.BASE_URL;