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

feat(dw-edit-managed-sources): Edit Self Managed Sources for DW #28111

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

phixMe
Copy link
Contributor

@phixMe phixMe commented Jan 30, 2025

Problem

We cannot currently edit self managed sources for DW.

Note: For some reason, we reference the /query response when building the list of self-managed sources. I have a followup change to update that so they we have more properties to work with and render within the table. It also gives up some stronger typing since it's out of the api directly and less coercion is needed.

image image

Changes

We are getting the fields that we can right now w/o whitelisting hashed sensitive credentials and flushing them down to the client.

  • Migrate create form to create/update form
  • Several misc code quality and organizational changes
  • Icon added to make self managed table resemble the sources table
  • Making self managed sources look more similar to managed sources
  • Fix issue on invalid table names for HogQL
  • Cache invalidation of queries endpoint upon an update

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Added, changed items

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Size Change: -5 B (0%)

Total Size: 1.18 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.18 MB -5 B (0%)

compressed-size-action

@phixMe phixMe changed the title feature(dw-edit-managed-sources): Edit Managed Sources for DW feat(dw-edit-managed-sources): Edit Managed Sources for DW Jan 30, 2025
@phixMe phixMe marked this pull request as ready for review January 30, 2025 23:39
@phixMe phixMe requested a review from a team January 30, 2025 23:39
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

This PR adds functionality for editing self-managed data warehouse sources, with significant changes across multiple components. Here's a summary of the key changes:

  • Added new DataWarehouseTableForm component supporting both creation and updates of warehouse tables with credential handling
  • Created standalone DataWarehouseSourceIcon component with provider mapping for consistent source visualization
  • Implemented validation for HogQL table names and URL patterns for different cloud storage providers in dataWarehouseTableLogic
  • Added new SelfManaged component in pipeline sources for editing existing data warehouse tables
  • Extended PipelineBackend enum with DataWarehouse type and updated node handling logic for self-managed sources
  • Improved form validation with regex checks for table names and URL patterns
  • Added cache invalidation of queries endpoint upon source updates

The changes maintain type safety while adding editing capabilities for self-managed sources, with consistent UI between managed and self-managed sources.

13 file(s) reviewed, 22 comment(s)
Edit PR Review Bot Settings | Greptile

@phixMe phixMe changed the title feat(dw-edit-managed-sources): Edit Managed Sources for DW feat(dw-edit-managed-sources): Edit Self Managed Sources for DW Jan 31, 2025
Copy link
Member

@Gilbert09 Gilbert09 left a comment

Choose a reason for hiding this comment

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

A few minor points, most blocking is the useEffect vs kea logic - looks good otherwise 👌

@phixMe phixMe requested a review from Gilbert09 February 3, 2025 18:20
@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 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

phixMe and others added 2 commits February 3, 2025 12:51
@EDsCODE EDsCODE requested a review from a team February 5, 2025 17:14
Copy link
Member

@EDsCODE EDsCODE left a comment

Choose a reason for hiding this comment

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

Tested. Looks good!

One NIT I found was that if I click to edit -> hit cancel -> click to edit immediately, the fields aren't prefilled anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants