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

Replace the old scraping code with new WebFlux-based scraping actions #411

Merged
merged 15 commits into from Jul 18, 2020

Conversation

mcpierce
Copy link
Contributor

Status

READY

Migrations

YES

Description

Designed a new scraping system based on a ScrapingAdaptor and individual ScrapingAction objects. Replaced the old caching tables with a new concise pair of tables.

@mcpierce mcpierce added the enhancement A pull request containing a a new feature, refactoring, or security improvement.. label Jul 17, 2020
@mcpierce mcpierce added this to the 0.7 milestone Jul 17, 2020
Copy link
Contributor

@BRUCELLA2 BRUCELLA2 left a comment

Choose a reason for hiding this comment

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

3 minor details to check.

* @return the list of volumes
* @throws ScrapingException if an error occurs
*/
List<ScrapingVolume> getVolumes(String apiKey, String seriesName, boolean skipCache)
Copy link
Contributor

Choose a reason for hiding this comment

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

Parameters can be declared "final" (they are final in the implementation).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn’t the final keyword only useful on an implementation: ie an implementing class can drop the final keyword?

Copy link
Contributor

Choose a reason for hiding this comment

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

I learn something :) I'm still a rookie ;)
It's true, final can be drop in the implementation and adding the final word in an interface can therefore be counter-intuitive as the interface contract that indicates that the parameter will not be reassigned could be reassigned in the implementation.
Don't you think then that we should remove the "final" in the scrapeComic method in the interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I was getting at before: "final" only applies to an actual implementation of the method and not to the interface. We could put "final" here and someone could implement the interface and leave it off and it wouldn't be a compile time error: final serves no purpose in an interface.

* @return the issue or null
* @throws ScrapingException if an error occurs
*/
ScrapingIssue getIssue(String apiKey, Integer volume, String issueNumber, boolean skipCache)
Copy link
Contributor

Choose a reason for hiding this comment

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

Parameters can be declared "final" (they are final in the implementation).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See previous reply.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok see previous reply.


log.debug(
"Querying ComicVine for issue: id={} API key={}", this.issueId, this.getMaskedApiKey());
final String url = this.createUrl(this.baseUrl, this.getEndpoint());
Copy link
Contributor

Choose a reason for hiding this comment

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

if baseUrl is null couldn't that be a problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, thanks for catching that. I've updated the branch to include at test for that condition.

@sonarcloud
Copy link

sonarcloud bot commented Jul 18, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

88.4% 88.4% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@BRUCELLA2 BRUCELLA2 left a comment

Choose a reason for hiding this comment

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

it's ok for me

@BRUCELLA2 BRUCELLA2 merged commit becb14e into comixed:develop Jul 18, 2020
@mcpierce mcpierce deleted the feature/issue-301 branch July 19, 2020 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A pull request containing a a new feature, refactoring, or security improvement..
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants