Conversation
ae31092 to
82efaea
Compare
There was a problem hiding this comment.
Pull request overview
Updates the Flux function help content and improves how examples are rendered in the UI, and adds a helper script to regenerate Flux help patches from the docs-v2 repository.
Changes:
- Render Flux function examples as preformatted text so multi-line snippets display correctly.
- Update snippet styling to preserve newlines and inherit typography.
- Add a Python script (and README) to generate a unified diff for syncing Flux help entries from local
docs-v2.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/flux/components/flux_functions_toolbar/TooltipExample.tsx | Switches example rendering to <pre> to preserve multi-line formatting. |
| ui/src/flux/components/flux_functions_toolbar/FluxFunctionsToolbar.scss | Updates .flux-functions-toolbar--snippet styling to better support <pre> and wrapped whitespace. |
| scripts/flux-help-sync.py | Adds a generator script that builds a patch to sync Flux help entries from local docs. |
| scripts/flux-help-sync.README.md | Documents how to run the sync script and what it outputs. |
| CHANGELOG.md | Adds a changelog entry referencing this PR. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bbd7da2 to
d8d20a7
Compare
|
no idea why cluster fails to deploy for e2e |
bednar
left a comment
There was a problem hiding this comment.
The code looks good to me 🚀.
Before merging, please wait for approval from @karel-rehor — he will test the solution in the UI.
|
I've tested the UI in Opera. There are a couple of questions that need to be resolved before I can approve. The test results are in FluxHelpTestPlan.html
|
|
OK. There is a clear regression issue with clicking and inserting functions with this release. On attempting to insert a To recreate.
With the current release (1.10.9) the default map function in the pipeline works and the visualization is updated. See the following screencasts. InsertMapFunction-Release1_10_9.webmInsertMapFunxtion-PR6170.webmPerhaps this functionality can be reworked to insert something other than the example. Suggestion {
name: 'map',
args: [
{
name: 'fn',
desc: 'Single argument function to apply to each record.',
type: 'Function',
},
{
name: 'mergeKey',
desc:
'_(Deprecated)_ Merge group keys of mapped records. Default is `false`.',
type: 'Boolean',
},
],
package: '',
desc: 'Iterates over and applies a function to input rows.',
example:
'import "sampledata"\n\nsampledata.int()\n |> map(fn: (r) => ({r with _value: r._value * r._value}))',
inserts: '|> map(fn: (r) => ({ r with _value: r._value * r._value }))'
category: 'Transformations',
link: 'https://docs.influxdata.com/flux/v0/stdlib/universe/map/',
}Maybe a new field Maybe the handler is here |
f136aa0 to
0eaca5b
Compare
|
@karel-rehor Fixed. Code in examples is just function call without any formatting, as it was before. |
OK, I'll start retesting, based on same plan. |
|
I see another issue with click and insert functions, however this is not a regression. It is also present in release 1.10.9 and I think may have been around for a while. Some functions like InsertInlineStringTrimRight.webmSince this is an already existing issue, I don't think it should block this PR. I'll create a related issue in the repository. Unless, of course, we want to fix this with this release. |
Agree. Fixing this issue is beyond the scope of this pull request. |
|
OK tested the latest changes. Report is here. Two minor issues were encountered when inserting functions. After inserting
Neither of these functions is available in release 1.10.9. The question then arrises, if access to these functions requires configuration with additional libraries, should they be made available in the UI if that configuration has not been added? Regarding problems with inserting inline functions as pipeline functions a separate issue has been opened. #6172 |
|
Strange... this runs OK for me in Chronograf script editor, against InfluxDB OSS 2.7: |
Co-authored-by: Jakub Bednář <jakub.bednar@gmail.com>
|
Yes, the test stack I've been working with inherited Influxdb version 1.8 by default. I've updated it to use 1.11. The newer flux functions are there. So everything looks good, except for the inserts issue which is out of scope. |
There was a problem hiding this comment.
Functional testing of the UI changes looks good to me.
Reported one new issue (#6172) out of scope for this PR.
🚴 🏁


Closes #
Flux functions help was not updated for a very long.
This PR
sleep- removed in v0.123 2021-07-19)aggregateWindow)scripts/flux-help-sync.pyfor generating Flux help update patches from Flux documentation indocs-v2repository. If patch looks ok, it can be applied withgit apply flux-help.diff. Seescripts/flux-help-sync.README.mdabout rules of patch generation.