-
Notifications
You must be signed in to change notification settings - Fork 124
Add runtime field flag in documentation files #2415
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
Conversation
Update how string is built by using fmt.Fprintf. Related to the static check QF1012 https://staticcheck.dev/docs/checks/#QF1012
@@ -44,82 +43,6 @@ type ReusableConfig struct { | |||
TopLevel bool `yaml:"top_level"` | |||
} | |||
|
|||
func (orig *FieldDefinition) Update(fd FieldDefinition) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find any usages of this Update
function in the elastic-package
code base.
It looks like that it was removed in this PR #1335:
https://github.com/elastic/elastic-package/pull/1335/files#diff-77cc155ee037ac620b1e188302f60fdf736637a25e5021e76dbad83594edd09cL133
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, this used to be neccesary 🤔 But good if we don't need it anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least, that function is not called anymore...
/test |
2 similar comments
/test |
/test |
internal/fields/model_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed test (file) related to the Update
function.
In this PR, it is implemented that the runtime flag is added next to the type of the field: | day_of_week | Day of week. | keyword (runtime) | | |
| labels.\* | | keyword (runtime) | | |
| package_registry.day_of_week | Other day of week. | keyword (runtime) | | |
| package_registry.day_of_week2 | Day of week 2. | keyword (runtime) | | |
| package_registry.labels.version | Elastic Package Registry version. | keyword (runtime) | | | Another option would be to set the runtime flag in the first column (field name). It could be like this: | day_of_week (runtime) | Day of week. | keyword | | |
| labels.\* (runtime) | | keyword| | |
| package_registry.day_of_week (runtime) | Other day of week. | keyword | | |
| package_registry.day_of_week2 (runtime) | Day of week 2. | keyword | | |
| package_registry.labels.version (runtime) | Elastic Package Registry version. | keyword | | | Which of the two ways do you think shows better the runtime fields to the user? |
I think it would be better in the type? 🤔 But not a strong opinion, as you prefer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but can this break current integrations builds? Or there is no package using runtime
?
@@ -44,82 +43,6 @@ type ReusableConfig struct { | |||
TopLevel bool `yaml:"top_level"` | |||
} | |||
|
|||
func (orig *FieldDefinition) Update(fd FieldDefinition) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, this used to be neccesary 🤔 But good if we don't need it anymore.
Currently, there are no packages using $ git grep "runtime:" |grep "yml:" |grep "fields/"
$ EDIT:
|
💚 Build Succeeded
History
cc @mrodm |
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#12824 |
Packages failing in that PR are the expected ones related to validation based on mappings: |
Closes #1229
Description
This PR updates the generation of fields documentation to include the runtime flag in the corresponding field definitions.
Example of the docs if runtime flag is added in the same column as the type:
How to test this PR locally
Go to a package and add some runtime field definitions:
Build your package with
elastic-package
and check the README docs built: