-
Notifications
You must be signed in to change notification settings - Fork 3
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
Breaking changes for 5.0 release #93
Merged
Merged
Conversation
This file contains 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
sengi
approved these changes
Oct 3, 2022
Thanks for the cleanup! |
This method was deprecated back in October 2012 [1]. This now removes the method and resolves this todo. It's unfortunate that there was not a warning for the use of this method, but as it's been such a long time and that we're working towards a new major version this feels appropriate. [1]: 309ef59
These seemed unnecessary as it's just running URI over the returned argument and clients can do that. These had fallen out of sync with the interface the class actually had so it seemed best to remove them. From my GitHub search there's only a couple of places these are used in our code.
This puts all the instance methods as static methods so that a plek instance and Plek static are consistent in their behaviour. This also updates the previous change note for the method suggestions.
kevindew
force-pushed
the
remove-old-interface
branch
2 times, most recently
from
October 3, 2022 16:12
257afdc
to
e364af6
Compare
Previously this tool was very forgiving in what user input it accepted and this meant that some really horribly wrong stuff could be attempted to be salvaged. For example: ``` irb(main):005:0> Plek.find(" S76I%Gn?O^n ") => "http://signon.dev.gov.uk" ``` Which after this change now does: ``` irb(main):001:0> Plek.find(" S76I%Gn?O^n ") Traceback (most recent call last): 16: from /Users/kevin.dew/.rbenv/versions/2.7.6/bin/bundle:23:in `load' 15: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/libexec/bundle:34:in `<top (required)>' 14: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/friendly_errors.rb:123:in `with_friendly_errors' 13: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/libexec/bundle:46:in `block in <top (required)>' 12: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/cli.rb:24:in `start' 11: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/base.rb:476:in `start' 10: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/cli.rb:30:in `dispatch' 9: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor.rb:399:in `dispatch' 8: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' 7: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' 6: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/cli.rb:506:in `console' 5: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/cli/console.rb:19:in `run' 4: from (irb):1 3: from /Users/kevin.dew/.rbenv/versions/2.7.6/lib/ruby/2.7.0/forwardable.rb:235:in `find' 2: from /Users/kevin.dew/govuk/plek/lib/plek.rb:75:in `find' 1: from /Users/kevin.dew/govuk/plek/lib/plek.rb:149:in `valid_service_name' ArgumentError (Plek expects a service name only contain lowercase a-z, . (period) and - (dash) characters.) ``` This changes the behaviour so that it accepts only hostnames in lowercase with the expected characters and doesn't try to make fixes. I also expanded it to include numbers as this seemed an unusual omission. The expectation is that this will have a negligible effect on real code as it's unlikely that our committed code is not already valid.
Since the docs utilise the convenience methods it makes sense that our tests prefer them over the extra init step.
kevindew
force-pushed
the
remove-old-interface
branch
from
October 3, 2022 16:17
e364af6
to
efa7df5
Compare
Thanks for the review @sengi, some great spots! I'll probably wait a week or two to merge this so the deprecations has gone through. |
Hi @kevindew do you think we can merge this now? |
kevindew
changed the title
Other breaking changes for 5.0 release
Breaking changes for 5.0 release
Nov 18, 2022
@MuriloDalRi Yup, I can see a few apps will need a tweak for this (Whitehall, Short URL Manager, Link Checker API) but looks straightforward. |
@MuriloDalRi I've opened #96 to release it |
This was referenced Nov 21, 2022
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.
Since we have a 5.0 release looming: #92 I thought it'd be good to resolve the remaining TODO's in this repo and release other breaking changes.
This change does a few things:
external_url_for
was added and seem a bit unnecessary since they're barely used and just a wrapper forURI(Plek.find('x'))