8000 chore: add field to Surveys to allow external responses by lucasheriques · Pull Request #33994 · PostHog/posthog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: add field to Surveys to allow external responses #33994

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

Merged
merged 9 commits into from
Jun 23, 2025

Conversation

lucasheriques
Copy link
Contributor

Problem

Part of #33948.

Right now, surveys can only be answered as in-app. This field will gate surveys being accessible externally. No functionality changes here, just adding the migration.

Changes

adds the new field to Surveys model and proper migrations.

Did you write or update any docs for this change?

  • No docs needed for this change

How did you test this code?

no funcionality changes

@lucasheriques lucasheriques requested a review from a team June 20, 2025 18:42
@lucasheriques lucasheriques self-assigned this Jun 20, 2025
Copy link
Contributor
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added a new nullable boolean field is_publicly_shareable to the Survey model to enable external survey access without authentication, defaulting to false for security.

  • Added field is_publicly_shareable to Survey model in posthog/models/surveys/survey.py
  • Created migration file 0775_survey_is_publicly_shareable.py following Django patterns
  • Updated frontend Survey interface in frontend/src/types.ts to include the new field
  • Migration follows security-first principle by defaulting to false to maintain surveys as private by default

4 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Copy link
Contributor
github-actions bot commented Jun 20, 2025

Size Change: 0 B

Total Size: 2.58 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 2.58 MB

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

Caution

Detected flapping snapshots

These snapshots have auto-updated more than once since the last human commit:

  • scenes-app-settings-environment--settings-environment-details--light.png (chromium, shard 5)

The flippy-flappies are deadly and must be fixed ASAP. They're productivity killers.
Run pnpm storybook locally and make the fix now.
(Often, the cause is ResizeObserver being used instead of the better CSS container queries.)

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@marandaneto marandaneto requested a review from ioannisj June 23, 2025 15:06
Copy link
Contributor

Migration SQL Changes

Hey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:

posthog/migrations/0775_survey_is_publicly_shareable.py

BEGIN;
--
-- Add field is_publicly_shareable to survey
--
ALTER TABLE "posthog_survey" ADD COLUMN "is_publicly_shareable" boolean NULL;
COMMIT;

@lucasheriques lucasheriques merged commit d43e66d into master Jun 23, 2025
120 checks passed
@lucasheriques lucasheriques deleted the chore/external-surveys-db-migration branch June 23, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0