Skip to content

Reduce flakiness of license fetcher. #484

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

Merged
merged 2 commits into from
Jun 4, 2019
Merged

Conversation

allisonbm92
Copy link
Contributor

This commit is a simple fix to reduce the flakiness of downloading
licenses. The fetcher will now try up to three times and will insert a
small delay between each attempt. This delay will only affect builds
that would otherwise fail.

@googlebot googlebot added the cla: yes Override cla label Jun 3, 2019
String get() {
APACHE_2_LICENSE_URI.toURL().getText()
String processDocument(Document doc) {
// TODO(vkryachko, allisonbm92): This fails silently.
Copy link

Choose a reason for hiding this comment

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

Is the TODO to not fail silently?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, why do you return an empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've expanded details in the comments and removed the empty string.


TEXT_FORMATTER.getPlainText(doc.select('body > table > tbody > tr:nth-child(2) > td:nth-child(2) > table > tbody > tr:nth-child(3) > td > en > blockquote'))
String processDocument(Document doc) {
return TEXT_FORMATTER.getPlainText(doc.select("body > table > tbody > tr:nth-child(2) > td:nth-child(2) > table > tbody > tr:nth-child(3) > td > en > blockquote").get(0))
Copy link

Choose a reason for hiding this comment

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

Keep line length <100 characters?

@Override
URI getServiceUri() {
GNU_CLASSPATH_LICENSE_URI
// TODO(allisonbm92, vkryachko): This does not fetch the actual license!
Copy link

Choose a reason for hiding this comment

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

Can you put the missing work in this TODO? Why doesn't it fetch the actual license?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@yifanyang yifanyang 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 to me!

This commit is a simple fix to reduce the flakiness of downloading
licenses. The fetcher will now try up to three times and will insert a
small delay between each attempt. This delay will only affect builds
that would otherwise fail.
@allisonbm92 allisonbm92 merged commit addbcad into master Jun 4, 2019
@allisonbm92 allisonbm92 deleted the allison-licenses branch June 4, 2019 18:18
allisonbm92 added a commit that referenced this pull request Jun 11, 2019
My fix in #484 changed the way the Apache license was handled, and all
whitespace was stripped from this popular license. Essentially, the
original code fetched it directly with the URL class while the other
licenses were fetched with Jsoup.

This commit restores this behavior. This has the unfortunate side-effect
of re-introducing boilerplate code, but it's the most cost-effective
solution for now.
allisonbm92 added a commit that referenced this pull request Jun 11, 2019
My fix in #484 changed the way the Apache license was handled, and all
whitespace was stripped from this popular license. Essentially, the
original code fetched it directly with the URL class while the other
licenses were fetched with Jsoup.

This commit restores this behavior. This has the unfortunate side-effect
of re-introducing boilerplate code, but it's the most cost-effective
solution for now.
@firebase firebase locked and limited conversation to collaborators Oct 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants