Conversation
vladbarosan
commented
Jan 4, 2018
- Add job for live validation of swagger changes.
|
@veronicagg the python and ruby builds are failing. For some reason Ruby tries to build Looking at another build job it also would try there, but it skips since no file is involved in the PR. In this case it seems to build everything ( because no swagger is changed ? ). Do you know where that list is coming from and can we update it ? |
|
@vladbarosan with the latest reorganization of the repo (preview/stable) the specs are not were they used to be anymore, so our https://github.com/Azure/azure-sdk-for-ruby/blob/master/swagger_to_sdk_config.json is out of date for the cases where we point to specific specs (not readme.md files). I'll make a PR against azure-sdk-for-ruby to update the swagger_to_sdk_config.json file with the new paths. Thanks! |
|
@vladbarosan Python is failing because I already updated swagger-to-sdk to generate the content of this unmerged PR: Since Tuesday, SwaggerToSdk is able to configure itself automatically by parsing the Readme looking for a "swagger-to-sdk" section. Once I migrated the content from swagger-to-sdk conf, this kind of problem will no longer happen. In progress, sorry for the disagreement in the meantime. |
ec72d91 to
0638339
Compare
|
@veronicagg Sample output on validation failure https://travis-ci.org/vladbarosan/azure-rest-api-specs/jobs/325251898 At point preferably to have the result and the link to the logs posted to the PR. |
.travis.yml
Outdated
| - MODE=liveValidation PR_ONLY=true | ||
| global: | ||
| secure: n7Ptb5x7Zdq/7na2L68JlrRPbl/xWtiFQncO7fsrSVuVGI4Mhjj1LD2k07qWAdFPM1PaZYvCRWc3YwbXr1NTOOn485r6qcLUjpN9TICP0ErGcEA9SzctipfbFP1IV4aCh23WSaopMueBki52KfskaGcZ2ox9pvI2LCysCp7q4WwF/0vArLYf48FeZuscWHVaLsU4z8ZMFPT9yHg+RQoqPeBnaR/ZGtG96NZolT+VAlP445geb0qn8wWAuSl4bR1JQV2eA3MwdWu/iVkepBeKTN7d81l3yjWzTvFtP/JRJClWBNQbOMjAed3/2Tr2lGgyRUM6Uwp4KvfRmbX3Xrlggen1AO/YAb2mJDs+HARPnhZXIOtDjgft/ethVeLTTBUsbNFGUN2lcrJMw9dkFi+ai3XefatENJbULqWx8Xb+wMD1b0TrI6sZZpdC8vYHnM/DoqiEh5+h3okkSmQcjPF4K9js294G790PKf4u2CQdur41qh4Ze4IzbvulVsGMON+O93vA6ZRK1sTHC5VUTs2iMhCnf6LtMN59kBq1T2MJ8ndXRpGlFEn2wDTjJSpSr0k0sjoG5i+bIFhbqVF8xegBb/PH4H9/i1ifIypNNp0FGdz4o2cFsYrcUKFsx1C/kFJ6rC809r0odDt32hGSOkOCziTwFHusbR5Nwf0RjOWSgvc= | ||
| secure: >- |
There was a problem hiding this comment.
what's the reason for this change?
There was a problem hiding this comment.
| - env: MODE=model PR_ONLY=true | ||
| - env: MODE=BreakingChange PR_ONLY=true | ||
| - env: MODE=azurebot PR_ONLY=true | ||
| - env: MODE=liveValidation PR_ONLY=true |
There was a problem hiding this comment.
should we remove "env: MODE=linter PR_ONLY=false" since you're cleaning up the file anyway?
There was a problem hiding this comment.
.travis.yml
Outdated
| - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file | ||
| # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu | ||
| - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | ||
| - >- |
There was a problem hiding this comment.
does ">-" just allow multiple lines on the script?
There was a problem hiding this comment.
| before_install: | ||
| - docker pull lmazuel/swagger-to-sdk | ||
| - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file | ||
| # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu |
There was a problem hiding this comment.
why are we removing this comment?
There was a problem hiding this comment.
I have the format on save, which did most of these changes :)
In reply to: 159792221 [](ancestors = 159792221)
.travis.yml
Outdated
| - >- | ||
| if [[ $MODE == 'ruby' ]]; then $DOCKER_CMD AutorestCI/azure-sdk-for-ruby | ||
| --pr-repo-id Azure/azure-sdk-for-ruby -o master -v; fi | ||
| - 'if [[ $MODE == ''syntax'' ]]; then npm test -- test/syntax.js; fi' |
There was a problem hiding this comment.
why do we need quotes around these lines? and double quotes for the MODE values?
package.json
Outdated
| "@microsoft.azure/async-io": "^1.0.21", | ||
| "@microsoft.azure/literate": "^1.0.21", | ||
| "@microsoft.azure/polyfill": "^1.0.17", | ||
| "azure-storage": "^2.1.0", |
There was a problem hiding this comment.
what do you need azure-storage dependency for?
There was a problem hiding this comment.
it was already here, just sorted in alphabetic order. not sure who has dependency on it, searching in the repo there is no reference, I can remove it
In reply to: 159792564 [](ancestors = 159792564)
scripts/liveValidation.js
Outdated
| validationService = "https://app.azure-devex-tools.com/api/validations", | ||
| branch = utils.getSourceBranch(), | ||
| processingDelay = 20, | ||
| isRunningInTraviCI = process.env.MODE === 'liveValidation' && process.env.PR_ONLY === 'true', |
There was a problem hiding this comment.
typo in name, "Travi" -> "Travis"
| return; | ||
| } | ||
|
|
||
| let resourceProvider = validationModels.keys().next().value; |
There was a problem hiding this comment.
could this fail? is there always a keys().next().value?
There was a problem hiding this comment.
are you only expecting 1 resourceProvider?
There was a problem hiding this comment.
There was a problem hiding this comment.
here it won't fail since we just return before that if the validationModels is empty (i.e. there is no swagger in the change)
| } | ||
|
|
||
| let resourceProvider = validationModels.keys().next().value; | ||
| let apiVersion = validationModels.get(resourceProvider).values().next().value; |
There was a problem hiding this comment.
similar question to the one above for this
There was a problem hiding this comment.
are you only expecting 1 api version, what if there are multiple involved in the changed files?
There was a problem hiding this comment.
yes currently only 1 api version supported so getting only first 1. Will actually put a message in case tehre are multiple to inform that only the first match gets used
In reply to: 159793778 [](ancestors = 159793778)
There was a problem hiding this comment.
ok, regarding multiple resource providers or multiple api-versions. It's good if there's a clear message about that. You may want to log an issue in your tool repo about this, so you can refer to it when it occurs in a PR, I'm sure it'll be occurring and you can collect feedback and number of instances by referring to it.
scripts/liveValidation.js
Outdated
| let validationId = JSON.parse(response).validationId; | ||
|
|
||
| let validationResultUrl = `${validationService}/${validationId}`; | ||
| console.log(`Request done, results will be available at ${validationResultUrl} in ${durationInSeconds} seconds...`); |
There was a problem hiding this comment.
looking at the sample output, not sure that the link in this line is that helpful, it does contain the result, but not easily readable, so you may want to include this link in a "log" line that doesn't lead the user to use it. The way it's included here, seems like the first thing I'd check.
There was a problem hiding this comment.
That is there just for reference, after the result is returned it displays the results. Take a look at https://travis-ci.org/vladbarosan/azure-rest-api-specs/jobs/325251898 for a sample
There was a problem hiding this comment.
You might be right to hide it though as it might distract, will update.
3e21aa0 to
a64b73b
Compare
.travis.yml
Outdated
There was a problem hiding this comment.
This is just coming back as commented out, as it had been removed in the previous commit. thanks!
scripts/liveValidation.js
Outdated
There was a problem hiding this comment.
minor typo: upper case "S" isRunningInTraviSCI
scripts/liveValidation.js
Outdated
There was a problem hiding this comment.
"will be ready in" ?
I think it's good to remove it from here, if the output is useful for debugging (particularly for you or reviewers) feel free to write out the link, just somewhere else maybe in parenthesis or something - like "Note: raw results at "
There was a problem hiding this comment.
well actually I print later everything that comes from there, but maybe ill add it as you mentioned "with raw results at"
| } | ||
|
|
||
| let resourceProvider = validationModels.keys().next().value; | ||
| let apiVersion = validationModels.get(resourceProvider).values().next().value; |
There was a problem hiding this comment.
ok, regarding multiple resource providers or multiple api-versions. It's good if there's a clear message about that. You may want to log an issue in your tool repo about this, so you can refer to it when it occurs in a PR, I'm sure it'll be occurring and you can collect feedback and number of instances by referring to it.
veronicagg
left a comment
There was a problem hiding this comment.
few minor comments, approving PR, thanks!
a64b73b to
ef3bd27
Compare
|
No modification for AutorestCI/azure-sdk-for-python |
|
No modification for AutorestCI/azure-sdk-for-ruby |