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

Deny unknown connector fields. #1606

Merged
merged 6 commits into from
May 4, 2022
Merged

Conversation

mfelsche
Copy link
Member

@mfelsche mfelsche commented May 3, 2022

Pull request

Description

Previously it was possible to mistype e.g. the field preprocessors as preprocessor and Tremor would have swallowed that error silently. With this PR, tremor will raise an error and complain.

Related

  • RFC
  • Related Issues: fixes #000, closed #000
  • Related docs PR

Checklist

  • The RFC, if required, has been submitted and approved
  • Any user-facing impact of the changes is reflected in docs.tremor.rs
  • The code is tested
  • Use of unsafe code is reasoned about in a comment
  • Update CHANGELOG.md appropriately, recording any changes, bug fixes, or other observable changes in behavior
  • The performance impact of the change is measured (see below)
  • Make this a hygienic error

Performance

@Licenser
Copy link
Member

Licenser commented May 3, 2022

We could validate the fields in the up function of ConnectorDefinitionRaw and from then on out assume "correctness"?

@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #1606 (b577124) into main (9eed714) will increase coverage by 85.62%.
The diff coverage is 91.87%.

@@            Coverage Diff            @@
##           main    #1606       +/-   ##
=========================================
+ Coverage      0   85.62%   +85.62%     
=========================================
  Files         0      232      +232     
  Lines         0    47109    +47109     
=========================================
+ Hits          0    40339    +40339     
- Misses        0     6770     +6770     
Flag Coverage Δ
unittests 85.62% <91.87%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/connectors/impls/cb.rs 3.22% <0.00%> (ø)
src/connectors/impls/crononome.rs 90.10% <0.00%> (ø)
src/connectors/impls/http/server.rs 80.73% <0.00%> (ø)
src/connectors/impls/kafka.rs 65.00% <0.00%> (ø)
src/connectors/impls/kv.rs 1.73% <0.00%> (ø)
src/connectors/impls/otel/client.rs 21.78% <ø> (ø)
src/connectors/impls/otel/server.rs 25.24% <ø> (ø)
src/connectors/impls/tcp/client.rs 91.42% <0.00%> (ø)
src/connectors/impls/ws/client.rs 74.04% <0.00%> (ø)
src/connectors/sink.rs 82.95% <ø> (ø)
... and 239 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9eed714...b577124. Read the comment docs.

@coveralls
Copy link
Collaborator

coveralls commented May 3, 2022

Pull Request Test Coverage Report for Build 2270257264

  • 147 of 160 (91.88%) changed or added relevant lines in 13 files are covered.
  • 15 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.04%) to 85.498%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/connectors/impls/cb.rs 0 1 0.0%
src/connectors/impls/crononome.rs 0 1 0.0%
src/connectors/impls/http/server.rs 0 1 0.0%
src/connectors/impls/kv.rs 0 1 0.0%
src/connectors/impls/tcp/client.rs 0 2 0.0%
src/connectors/impls/ws/client.rs 0 2 0.0%
tremor-script/src/errors.rs 19 21 90.48%
src/connectors/impls/kafka.rs 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
src/connectors.rs 1 85.89%
src/connectors/sink.rs 1 82.75%
src/pipeline.rs 1 76.94%
tremor-value/src/value.rs 1 98.9%
src/connectors/source.rs 2 80.48%
tremor-script/src/arena.rs 3 69.84%
tremor-script/src/pos.rs 6 96.67%
Totals Coverage Status
Change from base Build 2268493504: 0.04%
Covered Lines: 39407
Relevant Lines: 46091

💛 - Coveralls

Signed-off-by: Matthias Wahl <matthiaswahl@m7w3.de>
Signed-off-by: Matthias Wahl <matthiaswahl@m7w3.de>
Signed-off-by: Matthias Wahl <matthiaswahl@m7w3.de>
Signed-off-by: Matthias Wahl <matthiaswahl@m7w3.de>
@mfelsche mfelsche force-pushed the deny_unknown_connector_fields branch from f66a5aa to ce64181 Compare May 4, 2022 13:10
Signed-off-by: Matthias Wahl <matthiaswahl@m7w3.de>
@mfelsche mfelsche marked this pull request as ready for review May 4, 2022 15:42
Copy link
Member

@Licenser Licenser left a comment

Choose a reason for hiding this comment

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

🚀

@mfelsche mfelsche merged commit 2ade398 into main May 4, 2022
@mfelsche mfelsche deleted the deny_unknown_connector_fields branch May 4, 2022 17:09
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.

None yet

3 participants