feat(logs): allow viewing and editing LogPipeline processors#2577
Open
suvvvv wants to merge 1 commit into
Open
feat(logs): allow viewing and editing LogPipeline processors#2577suvvvv wants to merge 1 commit into
suvvvv wants to merge 1 commit into
Conversation
The processors table on the pipeline detail page only allowed delete — isEditable was hardcoded false because a processor's configuration is polymorphic per type, so the generic ModelForm edit could not handle it. There was no way to view or change a processor's config short of deleting and recreating it. This adds an Edit action to each processor row that reuses the existing custom ProcessorForm in edit mode: - ProcessorForm accepts an optional initialProcessor. When provided it pre-fills the form from the processor's saved configuration (the inverse of buildConfiguration) and updates via ModelAPI.updateById instead of creating, preserving sortOrder. The modal title and submit label reflect edit vs create. - PipelineView fetches configuration/isEnabled/sortOrder via selectMoreFields and wires an Edit action button that opens the form for the selected processor. The Add Processor button clears any edit state. Opening a processor for edit also satisfies the "view configuration" need from the issue, since the form shows the full current config. Refs OneUptime#2516 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On the LogPipeline detail page, the Processors table only allowed delete —
isEditablewas hardcodedfalse. There was no way to view or change an existing processor's configuration short of deleting and recreating it.isEditablewas off for a real reason: a processor'sconfigurationis polymorphic per type (SeverityRemapper / AttributeRemapper / CategoryProcessor), so the genericModelFormedit can't render it. Creation already uses a customProcessorFormfor that reason.This adds view + edit by reusing that same custom form in edit mode:
ProcessorForminitialProcessorprop. When provided, the form opens pre-filled from the processor's savedconfiguration(the inverse ofbuildConfiguration), and on save callsModelAPI.updateByIdinstead ofcreate, preservingsortOrder.parseConfigurationhelper accepts the config as either an object or a JSON-string literal (both shapes occur in storage).PipelineViewconfiguration/isEnabled/sortOrderviaselectMoreFieldsso the row item is complete.Opening a processor for edit also covers the "view configuration" ask from the issue, since the form shows the full current config.
Why
Resolves the "cannot view or edit processor config" problem in #2516 — users no longer have to delete and recreate a processor to change it.
Testing
npx tsc --noEmit— clean for both changed files.eslint+ Prettier — clean.Refs #2516