-
Notifications
You must be signed in to change notification settings - Fork 100
Add supported Luci builders for cocoon repo #875
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5234762
add try builder file to cocoon
keyonghan f8d475c
add readme and test for json validity
keyonghan 3414692
formatting
keyonghan 9e630e2
clean up
keyonghan a98835a
typo
keyonghan cf08adc
add test to validate json contents
keyonghan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| This directory contains resources that the Flutter team uses during | ||
| the development of cocoon. | ||
|
|
||
| ## Luci builder file | ||
| `cocoon_try_builders.json` contains the supported luci try builders | ||
| for cocoon. It follows format: | ||
| ```json | ||
| { | ||
| "builders":[ | ||
| { | ||
| "name":"xxx", | ||
| "repo":"cocoon" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| This file will be mainly used in [`flutter/cocoon`](https://github.com/flutter/cocoon) | ||
| to trigger LUCI presubmit tasks. | ||
|
|
||
| If any new changes, please validate json contents by running | ||
| `dart validat_json.dart cocoon_try_builders.json`. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "builders":[ | ||
| { | ||
| "name":"Cocoon", | ||
| "repo":"cocoon" | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // Copyright 2020 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:convert'; | ||
| import 'dart:io' show File; | ||
|
|
||
| /// Validates if the input builders JSON file has valid contents. | ||
| /// | ||
| /// Examples: | ||
| /// dart validate_json.dart /path/to/json/file | ||
| Future<bool> main(List<String> args) async { | ||
| final String jsonString = await File(args[0]).readAsString(); | ||
| Map<String, dynamic> decodedJson; | ||
| bool decodedStatus = true; | ||
| try { | ||
| decodedJson = json.decode(jsonString) as Map<String, dynamic>; | ||
| final List<dynamic> builders = decodedJson['builders'] as List<dynamic>; | ||
| if (builders == null) { | ||
| print('Json format is violated: no "builders" exists. Please follow'); | ||
| print(''' | ||
| { | ||
| "builders":[ | ||
| { | ||
| "name":"xxx", | ||
| "repo":"cocoon" | ||
| } | ||
| ] | ||
| }'''); | ||
| return decodedStatus = false; | ||
| } | ||
| } on FormatException catch (e) { | ||
| print('error: $e'); | ||
| return decodedStatus = false; | ||
| } | ||
| print('Success.'); | ||
| return decodedStatus; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the test I was thinking something like a dart script that receives a the path of the json file as a flag and validates it has the correct content and the file is parseable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a separate dart file to validate the json contents:
validate_json.dart, and included it in the README.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, maybe not in this PR but can we run the validation in presubmit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try adding that in a separate PR.