You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/05/30 05:18:34 UTC
[PR] fix(ci): gate welcome message on first-time contributor association [superset]
rusackas opened a new pull request, #40543:
URL: https://github.com/apache/superset/pull/40543
### SUMMARY
The \"Congrats on your first PR\" workflow fires on **every** PR from returning contributors, including org members.
**Root cause:** `actions/first-interaction@v3` detects first-time contributors by querying the GitHub API for prior PRs, but the job's `permissions` block only grants `pull-requests: write`. That restricted token cannot list the repo's PR history, so the action silently falls back to treating every PR as a first — even from someone with hundreds of merged PRs.
**Fix:** Add a job-level `if` condition gating on `github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'`. GitHub computes `author_association` server-side before the workflow runs, so it's authoritative with no API calls required. The action only runs (and posts the comment) when GitHub itself confirms the author has never had a PR merged here.
The `author_association` values for returning contributors (`MEMBER`, `COLLABORATOR`, `CONTRIBUTOR`) all correctly skip the job.
### TESTING INSTRUCTIONS
- Open a PR as an org member → workflow job skips (condition false), no comment posted ✓
- Open a PR as a brand-new GitHub user with no prior contributions → workflow runs and posts the welcome comment ✓
### ADDITIONAL INFORMATION
- [ ] Has associated issue
- [ ] Required feature flags
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4581786062
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 2b6de1eec68d0364727e80bbbfc33a93fbd274d4 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a1a732a75edd00008203b7b |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-40543--superset-docs-preview.netlify.app](https://deploy-preview-40543--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DYtbCoAgEEX3Mt9JDymjHbQMTSXJGpkEk2jvzf06HM59IRGeKcMC0IAhfW07sw9PW1zc8HSiIB0-YhE-0J1FDuzwipV761LEulp-TLrXSg5ajc7ajjcPnTTKwPcD) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-40543--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4583461246
Oops! Not that I'm hopping around on branches too much or anything. Thanks for catching that... I should have before late-night tagging y'all. Fixing now...
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #40543:
URL: https://github.com/apache/superset/pull/40543#discussion_r3328182377
##########
superset/commands/chart/create.py:
##########
@@ -43,6 +44,13 @@ class CreateChartCommand(CreateMixin, BaseCommand):
def __init__(self, data: dict[str, Any]):
self._properties = data.copy()
+ if params_str := self._properties.get("params"):
+ params = json.loads(params_str)
+ if isinstance(params, dict) and "viz_type" in params:
+ # Only fall back to params when no top-level viz_type was supplied;
+ # an explicit top-level field takes precedence.
+ self._properties.setdefault("viz_type", params["viz_type"])
Review Comment:
This PR only changes `.github/workflows/welcome-new-users.yml` — there's no `viz_type` or `params` logic here. The comment appears to be on the wrong PR.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber merged PR #40543:
URL: https://github.com/apache/superset/pull/40543
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #40543:
URL: https://github.com/apache/superset/pull/40543#discussion_r3328170358
##########
superset/commands/chart/create.py:
##########
@@ -43,6 +44,13 @@ class CreateChartCommand(CreateMixin, BaseCommand):
def __init__(self, data: dict[str, Any]):
self._properties = data.copy()
+ if params_str := self._properties.get("params"):
+ params = json.loads(params_str)
+ if isinstance(params, dict) and "viz_type" in params:
+ # Only fall back to params when no top-level viz_type was supplied;
+ # an explicit top-level field takes precedence.
+ self._properties.setdefault("viz_type", params["viz_type"])
Review Comment:
**Suggestion:** The fallback copies `viz_type` from `params` without applying the same validation as `ChartPostSchema.viz_type` (string type/length). A request can pass schema validation (because `params` is only JSON-validated) but still inject a non-string or oversized `viz_type`, causing DB bind/constraint failures during create instead of a clean validation error. Validate the extracted fallback value before assigning it. [type error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ /api/v1/chart accepts invalid viz_type via params.
- ⚠️ Invalid viz_type surfaces as generic DB/create failure.
- ⚠️ Users lose field-specific viz_type validation feedback.
- ⚠️ Potentially inconsistent viz_type across params and column.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Call the chart creation API `POST /api/v1/chart/` handled by `ChartRestApi.post` at
`superset/charts/api.py:324-365`, sending JSON with required fields (`slice_name`,
`datasource_id`, `datasource_type`) and a `params` field containing a JSON string like
`{"viz_type": "<300+ character string>"}`, but omit the top-level `viz_type` field.
2. In `ChartRestApi.post`, the payload is validated by `ChartPostSchema`
(`superset/charts/schemas.py:187-207`): `params` passes `utils.validate_json`
(`superset/utils/schema.py:43-52`), which only checks that the string is valid JSON and
does not inspect or constrain the embedded `viz_type` field, so the request passes schema
validation despite the oversized inner `viz_type`.
3. `ChartRestApi.post` then constructs `CreateChartCommand(item)` at
`superset/charts/api.py:365`; inside `CreateChartCommand.__init__`
(`superset/commands/chart/create.py:43-52`), `params_str` is loaded with `json.loads`,
producing a dict whose `viz_type` key holds the oversized string, and because there is no
top-level `viz_type` key, the block at `create.py:49-52` executes and copies this
unvalidated value directly into `self._properties["viz_type"]` via `setdefault`, bypassing
the `Length(0, 250)` constraint defined for the top-level `viz_type` field in
`ChartPostSchema`.
4. When `CreateChartCommand.run` (`create.py:54-59`) is called, `validate()` does not
check `viz_type`, so `ChartDAO.create` persists `self._properties` into the `Slice` model
(`superset/models/slice.py:68-82`), where `viz_type` maps to a `String(250)` column; on
commit, the database can raise a `DataError` or related constraint/bind error because the
value exceeds the column size, which is then wrapped as `ChartCreateFailedError` by the
`@transaction` decorator (`superset/utils/decorators.py:235-252`), causing a generic 422
error from `ChartRestApi.post` (`charts/api.py:45-59`) instead of a clean, field-specific
validation error at schema level.
```
</details>
[Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=3d2828ff9d974bb0bbc2f7999647c323&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) | [Fix in VSCode Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=3d2828ff9d974bb0bbc2f7999647c323&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/commands/chart/create.py
**Line:** 49:52
**Comment:**
*Type Error: The fallback copies `viz_type` from `params` without applying the same validation as `ChartPostSchema.viz_type` (string type/length). A request can pass schema validation (because `params` is only JSON-validated) but still inject a non-string or oversized `viz_type`, causing DB bind/constraint failures during create instead of a clean validation error. Validate the extracted fallback value before assigning it.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40543&comment_hash=065f1fb8f266b0584e5c0054e75125d461463df2f6129dc8998c3351b559bdce&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40543&comment_hash=065f1fb8f266b0584e5c0054e75125d461463df2f6129dc8998c3351b559bdce&reaction=dislike'>👎</a>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4581781961
Congrats on making your first PR and thank you for contributing to Superset! :tada: :heart:
Please read our [New Contributor Welcome & Expectations](https://github.com/apache/superset/wiki/New-Contributor-Welcome-&-Expectations) guide.
We hope to see you in our [Slack](https://apache-superset.slack.com/) community too! Not signed up? Use our [Slack App](http://bit.ly/join-superset-slack) to self-register.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4583463798
@sfirke @hainenber fixed (for real, I think)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4585608078
I did the thing :D
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4581781575
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4581812147
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/40543?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 63.19%. Comparing base ([`43c3c06`](https://app.codecov.io/gh/apache/superset/commit/43c3c06035f7722f305f46518c6e134e6a372b6a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2b6de1e`](https://app.codecov.io/gh/apache/superset/commit/2b6de1eec68d0364727e80bbbfc33a93fbd274d4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 10 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #40543 +/- ##
==========================================
- Coverage 64.00% 63.19% -0.82%
==========================================
Files 2620 2637 +17
Lines 140974 141683 +709
Branches 32527 32572 +45
==========================================
- Hits 90236 89537 -699
- Misses 49187 50584 +1397
- Partials 1551 1562 +11
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.69% <20.00%> (+0.22%)` | :arrow_up: |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.32% <20.00%> (+0.21%)` | :arrow_up: |
| [python](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.37% <100.00%> (-1.71%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.25% <100.00%> (+0.04%)` | :arrow_up: |
| [unit](https://app.codecov.io/gh/apache/superset/pull/40543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/40543?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4581922520
The fix for `first-interaction` is A-OK for me but it seems there's an unrelated change ;)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(ci): gate welcome message on first-time contributor association [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on PR #40543:
URL: https://github.com/apache/superset/pull/40543#issuecomment-4583495223
I don't think either of us can merge this, it needs a codeowner. Which seems gratuitous in this case
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org