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

[INFRA-1666] If we are naming a file *.yml, convert from JSON first #1665

Merged
merged 1 commit into from Jul 20, 2018

Conversation

jglick
Copy link
Contributor

@jglick jglick commented Jul 20, 2018

…since there are apparently some subtle differences in metacharacter escapes. Explanation

Prerequisite for jenkins-infra/update-center2#217 to be merged acc. to @daniel-beck. I managed to reproduce the stated error by

diff --git a/scripts/fetch-external-resources b/scripts/fetch-external-resources
index b4902e5f..21e39f3a 100755
--- a/scripts/fetch-external-resources
+++ b/scripts/fetch-external-resources
@@ -39,7 +39,7 @@ RESOURCES = [
     nil
   ],
   [
-    'https://updates.jenkins.io/update-center.actual.json',
+    'https://ci.jenkins.io/job/Infra/job/update-center2/job/PR-217/2/artifact/output/latest/update-center.actual.json',
     'content/_data/_generated/update_center.yml',
     nil,
     nil

After applying this patch, the error goes away, and the security advisories index page and individual advisory pages appear to render correctly.

…since there are apparently some subtle differences in metacharacter escapes.
puts "Writing #{destination}"
if destination.include? ".yml"
puts "Converting JSON to YAML"
f.write(YAML.dump(JSON.load(response.body)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to lack a condition that checks whether the origin is *.json.

Copy link
Contributor Author

@jglick jglick Jul 20, 2018

Choose a reason for hiding this comment

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

True, though there are only foursix hard-coded resources for now, so YAGNI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(and one of them does not include the text json in its URL)

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably fine to merge and consider a TODO for later.

@daniel-beck daniel-beck merged commit 35968b4 into jenkins-infra:master Jul 20, 2018
@jglick jglick deleted the json2yaml-INFRA-1666 branch July 20, 2018 16:01
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.

None yet

2 participants