Conversation
181b750 to
5553c59
Compare
76a7e4f to
d0c333b
Compare
| /// Returns `true` if the package page contains `[pending analysis]`, | ||
| /// `false` otherwise. | ||
| Future<bool> isPendingAnalysis(String package) async { | ||
| final uri = Uri.parse('https://pub.dev/packages/$package'); |
There was a problem hiding this comment.
Does it make sense to make this a constant?
There was a problem hiding this comment.
You mean final instead of const?
Or moving https://pub.dev/packages/ to a const?
If second, I think it's okay to do it as for other urls in this file.
| // ANSI escape codes for terminal colors. | ||
| const _yellow = '\x1B[33m'; | ||
| const _green = '\x1B[32m'; | ||
| const _reset = '\x1B[0m'; |
There was a problem hiding this comment.
Do those help in CI/CD or can we simplify the code?
There was a problem hiding this comment.
It looks nicer in CI/CD too (it supports colors too, see e.g. https://github.com/aws-amplify/amplify-flutter/actions/runs/21951396667/job/63402913611?pr=6613). For me, it makes it easier to scan the output.
|
|
||
| final stopwatch = Stopwatch()..start(); | ||
|
|
||
| while (await isPendingAnalysis(package)) { |
There was a problem hiding this comment.
How does the loop break if isPendingAnalysis does not return true due to an issue with the underlying API?
There was a problem hiding this comment.
The exception gets to the main thread and the process crashes. So we would have to do manual handling.
| final request = AWSHttpRequest.get(uri); | ||
| final resp = await httpClient.send(request).response; | ||
| final body = await resp.decodeBody(); | ||
| return body.contains('[pending analysis]'); |
There was a problem hiding this comment.
Is this stable enough for our use-case? It could happen, that the presented HTML changes. Shouldn't we use the API, e.g. this call?
There was a problem hiding this comment.
I want to change this in the next step. I'd like to get some more data for that while we run this version.
d0c333b to
d6c4e9e
Compare
Before this change, we had to wait for a package do be analyzed and needed to restart afterwads:
With this change, it's like: