Skip to content

re-think how we calculate "since" info for published lints #58342

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

Open
pq opened this issue Mar 4, 2021 · 3 comments
Open

re-think how we calculate "since" info for published lints #58342

pq opened this issue Mar 4, 2021 · 3 comments
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) devexp-linter Issues with the analyzer's support for the linter package P3 A lower priority bug or feature request type-documentation A request to add or improve documentation type-enhancement A request for a change that isn't a bug type-task A well-defined stand-alone task

Comments

@pq
Copy link
Member

pq commented Mar 4, 2021

Context: SpinlockLabs/github.dart#244 (comment).

We currently use a very naive method to fetch all (and increasingly many) SDK repo tags to calculate when a lint was first included in an SDK and this is turning out to no longer scale. (Our caching scheme doesn't play nice with the frequent releases either.)

We should really re-think it.

@pq pq added type-enhancement A request for a change that isn't a bug type-documentation A request to add or improve documentation type-task A well-defined stand-alone task labels Mar 4, 2021
@robrbecker
Copy link

I gave this a test myself and yes indeed it takes 57 pages of tags for about 38s.
I think if I were to make this https://github.com/SpinlockLabs/github.dart/blob/master/lib/src/common/repos_service.dart#L245 look like
github.repositories.listTags(slug, page: 57, pages: 1, perPage: 30)
(ie allow passing in the starting page, how many pages to get, and the page size)

Then that would allow you to save the list of tags up to a certain page, and then next time it is run just request starting at the last page. You'd still have to resolve duplicates. Or I suppose if you did a page size of 1 you could just start where you left of and only get new tags since you last checked.

One thing to note is that the API returns the tags in the same order, but I don't know if that's guaranteed. Also changing the per_page means github calculates the starting point as per_page * page so asking for page 5 is not the same with different per_page requests. That means if you start caching tags you should always use the same page size. (or recalculate your starting point correctly)

Would it be helpful if I added the proposed changes?

@robrbecker
Copy link

Well, I published 8.0.0 with the pagination additions. https://github.com/SpinlockLabs/github.dart/blob/master/lib/src/common/repos_service.dart#L245
That should allow you to rework caching if you need.

@pq
Copy link
Member Author

pq commented Mar 8, 2021

Thanks so much @robrbecker!

@pq pq added the contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) label May 13, 2021
@srawlins srawlins added the P3 A lower priority bug or feature request label Oct 26, 2022
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 19, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 19, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) devexp-linter Issues with the analyzer's support for the linter package P3 A lower priority bug or feature request type-documentation A request to add or improve documentation type-enhancement A request for a change that isn't a bug type-task A well-defined stand-alone task
Projects
None yet
Development

No branches or pull requests

5 participants