Skip to content

Validate release is a String during configuration#2040

Merged
sl0thentr0py merged 1 commit intomasterfrom
neel/validate-release
May 16, 2023
Merged

Validate release is a String during configuration#2040
sl0thentr0py merged 1 commit intomasterfrom
neel/validate-release

Conversation

@sl0thentr0py
Copy link
Copy Markdown
Member

closes #2004

@sl0thentr0py sl0thentr0py requested a review from st0012 May 12, 2023 14:47
@codecov
Copy link
Copy Markdown

codecov bot commented May 12, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: +5.78 🎉

Comparison is base (c0dd6df) 77.37% compared to head (56ee1a1) 83.15%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2040      +/-   ##
==========================================
+ Coverage   77.37%   83.15%   +5.78%     
==========================================
  Files         110      119       +9     
  Lines        4954     5645     +691     
==========================================
+ Hits         3833     4694     +861     
+ Misses       1121      951     -170     
Impacted Files Coverage Δ
sentry-ruby/lib/sentry/configuration.rb 83.33% <66.66%> (+0.30%) ⬆️
...-ruby/lib/sentry/utils/argument_checking_helper.rb 83.33% <66.66%> (ø)

... and 20 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

end
end

def check_instance!(name, value, klass)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already have a helper to check argument types. Maybe we can update that method so it accepts 2 expected types?

Copy link
Copy Markdown
Member Author

@sl0thentr0py sl0thentr0py May 15, 2023

Choose a reason for hiding this comment

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

hmm I don't even think we need the nil check because no one should be setting release explicity to nil, I'll change the release_detector assignment above to an instance variable.

edit: nvm, breaks some other tests, will extend

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It may be easier for users because they can just set this and don't need to worry about if the env is present.

config.release = ENV["MY_RELEASE"]

If we raise in that case, users need to write

config.release = ENV["MY_RELEASE"] if ENV["MY_RELEASE"] 

AFTER seeing at least one error.

@sl0thentr0py sl0thentr0py force-pushed the neel/validate-release branch from 61ff2ad to 3a7acbb Compare May 15, 2023 14:18
@sl0thentr0py sl0thentr0py force-pushed the neel/validate-release branch from 3a7acbb to 56ee1a1 Compare May 15, 2023 14:42
@sl0thentr0py sl0thentr0py requested a review from st0012 May 15, 2023 14:51
@sl0thentr0py sl0thentr0py enabled auto-merge (squash) May 15, 2023 14:53
Copy link
Copy Markdown
Contributor

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Looks good. I will try a small refactor after this is merged.
BTW, is it possible that we can work with codecov developers to improve the coverage accuracy in this repo? These false warnings are pretty annoying 😕

@sl0thentr0py sl0thentr0py merged commit 093d0f2 into master May 16, 2023
@sl0thentr0py sl0thentr0py deleted the neel/validate-release branch May 16, 2023 14:30
@st0012 st0012 added this to the 6.0.0 milestone May 16, 2023
@st0012 st0012 modified the milestones: 6.0.0, 5.10.0 May 26, 2023
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.

Throw warning when release is not a string

2 participants