Skip to content

Commit

Permalink
Unsubmit donotsubmit (#324)
Browse files Browse the repository at this point in the history
...

---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Most changes should add an entry to the changelog and may need to [rev
the pubspec package
version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change).
- Changes to packages require [corresponding
tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing).

Note that many Dart repos have a weekly cadence for reviewing PRs -
please allow for some latency before initial review feedback.
</details>
  • Loading branch information
mosuem authored Dec 6, 2024
1 parent 8749a2b commit b4b2a43
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/health_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ jobs:
if: ${{ inputs.check == 'coverage' }}

- name: Install firehose
run: dart pub global activate --source git https://github.com/dart-lang/ecosystem --git-path pkgs/firehose/ --git-ref=forceFlutter
# DO-NOT-SUBMIT
run: dart pub global activate firehose
if: ${{ !inputs.local_debug }}

- name: Install local firehose
Expand Down
39 changes: 19 additions & 20 deletions pkgs/quest/bin/quest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ Future<void> main(List<String> arguments) async {
var gitUri = arguments[1].replaceRange(0, 'git'.length, 'https');
gitUri = gitUri.substring(0, gitUri.length - '.git'.length);
final branch = arguments[2];
final lines = arguments[3].split('\n');
final labels = lines
.sublist(1, lines.length - 1)
final labels = arguments[3]
.split('\n')
.map((e) => e.trim())
.where((line) => line.startsWith('ecosystem-test'));
print('Labels: $labels');
final packages = fire.Repository().locatePackages();
//TODO: Possibly run for all packages, not just the first.
final package = packages.firstWhereOrNull((package) =>
labels.any((label) => label == 'ecosystem-test-${package.name}'));
final package = packages.firstWhereOrNull(
(package) =>
labels.any((label) => label == 'ecosystem-test-${package.name}'),
);
if (package != null) {
print('Found $package. Embark on a quest!');
final version = '${package.name}:${json.encode({
Expand All @@ -35,25 +36,18 @@ Future<void> main(List<String> arguments) async {
'ref': branch,
'path':
p.relative(package.directory.path, from: Directory.current.path)
}
},
})}';
final chronicles = await Quest(
package.name,
version,
repositoriesFile,
).embark();
final chronicles =
await Quest(package.name, version, repositoriesFile).embark();
final comment = createComment(chronicles);
await writeComment(comment);
print(chronicles);
exitCode = chronicles.success ? 0 : 1;
}
}

enum Level {
solve,
analyze,
test;
}
enum Level { solve, analyze, test }

/// The result of embarking on a quest. Stores the [package] which was tested
/// with its new [version] as well as the [chapters] of the chronicles, each
Expand Down Expand Up @@ -84,8 +78,10 @@ class Chapter {

bool get success => failure == null;

Level? get failure => Level.values.firstWhereOrNull((level) =>
before[level]?.success == true && after[level]?.success == false);
Level? get failure => Level.values.firstWhereOrNull(
(level) =>
before[level]?.success == true && after[level]?.success == false,
);

String toRow(Application application) => '''
| ${application.name} | ${Level.values.map((l) => '${before[l]?.success.toEmoji ?? '-'}/${after[l]?.success.toEmoji ?? '-'}').join(' | ')} |''';
Expand Down Expand Up @@ -179,8 +175,11 @@ class Quest {
await runFlutter(['clean'], path);

print('Rev package:$candidatePackage to version $version $application');
final revSuccess =
await runFlutter(['pub', 'add', version], path, true);
final revSuccess = await runFlutter(
['pub', 'add', version],
path,
true,
);

print('Run checks for modified package');
final resultAfter = await runChecks(path, application.level);
Expand Down

0 comments on commit b4b2a43

Please sign in to comment.