Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

feat: use cache when listing PRs and issues #616

Merged
merged 4 commits into from
Aug 29, 2022
Merged

feat: use cache when listing PRs and issues #616

merged 4 commits into from
Aug 29, 2022

Conversation

alexander-fenster
Copy link
Contributor

We have 167 repositories matching my filters at this moment. Quite often, I need to do several things one after one, e.g. first tag all matching PRs, then approve. Listing across 167 repositories every time is painful, takes time, and consumes quota.

Let's cache everything for 1 hour. The break glass --nocache option is also provided.

@alexander-fenster alexander-fenster requested a review from a team as a code owner August 27, 2022 00:18
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Aug 27, 2022
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Aug 27, 2022
@alexander-fenster alexander-fenster added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 29, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 29, 2022
}
items.push(
...localItems.map(item => {
return {repo, item};
})
);
scanned++;
orb1.text = `[${scanned}/${repos.length}] Scanning repos for PRs`;
orb1.text = `[${scanned}/${repos.length}] Scanning repos for ${
type === 'issues' ? 'issue' : 'PR'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not familiar with type annotations in TypeScript and I'm really curious, is it possible to use String(type) here instead? would simplify these quite a bit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a ternary operator

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean it's simple enough imo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, could just use ${type} (type is already a string internally), it's just singular "issue" vs plural "issues" being handled here. I didn't invent anything new here, I just copy-pasted this from another place in the code, there are quite a lot of those.

@alexander-fenster alexander-fenster merged commit 6572a87 into main Aug 29, 2022
@alexander-fenster alexander-fenster deleted the cache branch August 29, 2022 20:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants