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

Migrate from GdsApi::PublishingApiV2 #1052

Merged
merged 13 commits into from Feb 14, 2020
Merged

Migrate from GdsApi::PublishingApiV2 #1052

merged 13 commits into from Feb 14, 2020

Conversation

@huwd
Copy link
Contributor

huwd commented Feb 13, 2020

When running tests to tidy up facet groups and business finder code. I noticed a lot of warnings about old test APIs that will be deprecated in future.

Thought, as I'm in here, I'll tidy up.

Followed CLI guidance to move over to new API.

@huwd

This comment has been minimized.

Copy link
Contributor Author

huwd commented Feb 13, 2020

Other things I'll address in other PRs:

Rails 6.1 deprecation warning
Should research and change these from using update_attribtues to update apparently.

User
  behaves like a gds-sso user class
DEPRECATION WARNING: update_attributes is deprecated and will be removed from Rails 6.1 (please, use update instead) (called from block (2 levels) in <top (required)> at /home/build/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/gds-sso-14.2.0/lib/gds-sso/lint/user_spec.rb:19)
    implements #update_attributes
    implements #create!
    implements #remotely_signed_out?
    implements #update_attribute
    the User class and GDS::SSO::User mixin work together
    implements #where
    #has_all_permissions?
DEPRECATION WARNING: update_attributes is deprecated and will be removed from Rails 6.1 (please, use update instead) (called from block (3 levels) in <top (required)> at /home/build/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/gds-sso-14.2.0/lib/gds-sso/lint/user_spec.rb:33)
      is false when there are no permissions
DEPRECATION WARNING: update_attributes is deprecated and will be removed from Rails 6.1 (please, use update instead) (called from block (3 levels) in <top (required)> at /home/build/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/gds-sso-14.2.0/lib/gds-sso/lint/user_spec.rb:39)
      is false when it does not have all required permissions
DEPRECATION WARNING: update_attributes is deprecated and will be removed from Rails 6.1 (please, use update instead) (called from block (3 levels) in <top (required)> at /home/build/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/gds-sso-14.2.0/lib/gds-sso/lint/user_spec.rb:45)
      is true when it has all required permissions

Default timeout in sections duplicate definitions
Should research if this is a problem and potentially correct

taxonomy:validate_taxons_base_paths
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: already initialized constant GdsApi::JsonClient::DEFAULT_TIMEOUT_IN_SECONDS
/home/build/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/gds-api-adapters-63.4.0/lib/gds_api/json_client.rb:41: warning: previous definition of DEFAULT_TIMEOUT_IN_SECONDS was here
  optionally fixes paths that do not have the correct level one prefix
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: already initialized constant GdsApi::JsonClient::DEFAULT_TIMEOUT_IN_SECONDS
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: previous definition of DEFAULT_TIMEOUT_IN_SECONDS was here
  outputs check as all-valid
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: already initialized constant GdsApi::JsonClient::DEFAULT_TIMEOUT_IN_SECONDS
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: previous definition of DEFAULT_TIMEOUT_IN_SECONDS was here
  does not fix the base paths by default
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: already initialized constant GdsApi::JsonClient::DEFAULT_TIMEOUT_IN_SECONDS
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: previous definition of DEFAULT_TIMEOUT_IN_SECONDS was here
  skips automatic fix for level one taxons
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: already initialized constant GdsApi::JsonClient::DEFAULT_TIMEOUT_IN_SECONDS
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: previous definition of DEFAULT_TIMEOUT_IN_SECONDS was here
  optionally fixes paths that do not have the correct level one prefix
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: already initialized constant GdsApi::JsonClient::DEFAULT_TIMEOUT_IN_SECONDS
/govuk/content-tagger/lib/tasks/taxonomy/validate_taxons_base_paths.rake:6: warning: previous definition of DEFAULT_TIMEOUT_IN_SECONDS was here
  captures errors that might occur during updates
@huwd huwd changed the title Migrate gds api test helpers Migrate from GdsApi::PublishingApiV2 Feb 13, 2020
@huwd huwd requested review from koetsier, vanitabarrett and laurentqro Feb 13, 2020
@huwd huwd marked this pull request as ready for review Feb 13, 2020
@kevindew

This comment has been minimized.

Copy link
Member

kevindew commented Feb 14, 2020

⭐️ 🏆 🥇

@leenagupte

This comment has been minimized.

Copy link
Contributor

leenagupte commented Feb 14, 2020

👼 🚀 🎉

@huwd huwd merged commit b385b91 into master Feb 14, 2020
3 checks passed
3 checks passed
continuous-integration/jenkins/branch This commit looks good
Details
continuous-integration/jenkins/publishing-e2e-tests Publishing end-to-end tests succeeded on Jenkins
Details
continuous-integration/jenkins/security No security issues found
Details
@huwd huwd deleted the migrate-gds-api-test-helpers branch Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.