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

THREESCALE-9183: Removing leftovers of source2swagger #3327

Merged
merged 5 commits into from
Apr 28, 2023

Conversation

mayorova
Copy link
Contributor

What this PR does / why we need it:

Cleaning up old source2swagger annotations and related code.

Which issue(s) this PR fixes

https://issues.redhat.com/browse/THREESCALE-9183

Verification steps
-none-

Special notes for your reviewer:

Based on #3103

@mayorova mayorova changed the title Removing leftovers of source2swagger THREESCALE-9183: Removing leftovers of source2swagger Apr 24, 2023
@nidhi-soni1104 nidhi-soni1104 marked this pull request as ready for review April 25, 2023 06:41
@nidhi-soni1104 nidhi-soni1104 self-requested a review April 25, 2023 06:41
nidhi-soni1104
nidhi-soni1104 previously approved these changes Apr 25, 2023
Copy link
Contributor

@nidhi-soni1104 nidhi-soni1104 left a comment

Choose a reason for hiding this comment

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

LGTM

jlledom
jlledom previously approved these changes Apr 25, 2023
Copy link
Contributor

@jlledom jlledom left a comment

Choose a reason for hiding this comment

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

I'm all for this cleanup. If the tests pass, approved. Just one thing: the comments removed here contain a list of accepted parameters for each endpoint which I find useful, shouldn't we keep the list?, no matter the format.

The idea is to replace source2swagger by rswag in the future. If I'm not wrong, I'd say in rswag you need to write specs where you define the interface for the endpoint, so we'll probably need the list of parameters in order to write those specs.

@mayorova mayorova marked this pull request as draft April 25, 2023 08:22
@@ -250,8 +250,6 @@ group :development, :test do
gem 'pry-shell'
gem 'pry-stack_explorer'

# for `rake doc:liquid:generate` and similar
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this relevant? Should we remove/edit this task?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was a "typo" and it referred to doc:swagger:generate which I already removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need swagger-ui_rails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we still need swagger-ui_rails?

I'm afraid we do. I believe this is for Swagger v1, and we still support rendering Swagger UI for v1 specs for our customers.

Base automatically changed from THREESCALE-3927-update-to-openapi to master April 27, 2023 09:49
@mayorova mayorova dismissed stale reviews from jlledom and nidhi-soni1104 via 99d0d41 April 27, 2023 09:49
@mayorova mayorova force-pushed the cleanup-old-swagger-annotations branch from 99d0d41 to 7e6e7a1 Compare April 27, 2023 13:01
@mayorova mayorova force-pushed the cleanup-old-swagger-annotations branch from 31c95c3 to 24d3dd9 Compare April 28, 2023 09:07
@mayorova mayorova marked this pull request as ready for review April 28, 2023 09:09
Copy link
Contributor

@akostadinov akostadinov left a comment

Choose a reason for hiding this comment

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

Some questions left on your consideration. lgtm, thanks!

def missing_config
false
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently this leftover was not used anymore. But what if old customers have this rolling update in their custom configuration? Would then their upgrade fail? Should we keep this forever or document that it needs to be removed before upgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean if they have new_provider_documentation: true in their rolling_updates.yml.

Well, they are not supposed to touch this configuration in the first place :)

Secondly, why would they do that? Just to load a broken Swagger v2 Active Docs for 3scale APIs? :)

And most importantly, the rolling_updates.yml can contain extra features, and if there is no code to process them, then they would be just ignored.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, I think it failed for me like that in the past, maybe don't remember. But it makes sense, nobody would have used v2.

@@ -299,7 +299,6 @@ def call(env)

namespace :api_docs do
resource :account_data, :only => [:show]
resources :specs, only: :show
Copy link
Contributor

Choose a reason for hiding this comment

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

what was that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a controller to load Swagger 2.0 specs:

/p/admin/api_docs/specs/finance.json
/p/admin/api_docs/specs/analytics.json
/p/admin/api_docs/specs/accounts.json

The controller itself app/controllers/provider/admin/api_docs/specs_controller.rb was also deleted.

@mayorova mayorova merged commit 0b03c2c into master Apr 28, 2023
@mayorova mayorova deleted the cleanup-old-swagger-annotations branch April 28, 2023 12:45
thalesmiguel pushed a commit to thalesmiguel/porta that referenced this pull request May 2, 2023
* Removing leftovers of source2swagger

* Remove circleci job for swagger generation

* More source2swagger removals

* More cleanups

* Fix CircleCI config
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.

6 participants