From 8f99b83c09043504f93ef161c4a39da609f3e629 Mon Sep 17 00:00:00 2001 From: Dmitry Kisler Date: Tue, 28 Nov 2023 16:57:39 +0100 Subject: [PATCH] Remove RSS throttling limits Signed-off-by: Dmitry Kisler --- .../bump-versions-test-rss-throttling.yml | 29 +++++++++++++++++++ src/cmd/bump-versions/main.go | 5 +++- src/internal/github/rss.go | 5 ++-- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/bump-versions-test-rss-throttling.yml diff --git a/.github/workflows/bump-versions-test-rss-throttling.yml b/.github/workflows/bump-versions-test-rss-throttling.yml new file mode 100644 index 0000000000..33b6133bc6 --- /dev/null +++ b/.github/workflows/bump-versions-test-rss-throttling.yml @@ -0,0 +1,29 @@ +name: Bump Providers Test + +on: + workflow_dispatch: + push: + +jobs: + bump-versions: + runs-on: ubuntu-latest + + permissions: + # these permissions are required for RSS feed + # even if the runner writes nothing to the repo + contents: write + actions: write + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: './src/go.mod' + + - name: Run version bump script + working-directory: ./src + run: go run ./cmd/bump-versions diff --git a/src/cmd/bump-versions/main.go b/src/cmd/bump-versions/main.go index b87dc066e3..318a7ba982 100644 --- a/src/cmd/bump-versions/main.go +++ b/src/cmd/bump-versions/main.go @@ -47,7 +47,10 @@ func main() { logger.Error("Failed to list providers", slog.Any("err", err)) os.Exit(1) } - err = providers.Parallel(20, func(p provider.Provider) error { + + // FIXME: test assumption that we won't hit the throttling limit of the RSS feed + concurrencyProviders := len(providers) + err = providers.Parallel(concurrencyProviders, func(p provider.Provider) error { return p.UpdateMetadataFile() }) if err != nil { diff --git a/src/internal/github/rss.go b/src/internal/github/rss.go index 8188174fdf..4336bda20e 100644 --- a/src/internal/github/rss.go +++ b/src/internal/github/rss.go @@ -42,8 +42,9 @@ func (c Client) extractTag(item *gofeed.Item) *string { } func (c Client) getReleaseRSSFeed(releasesRSSURL string) (*gofeed.Feed, error) { - done := c.rssThrottle() - defer done() + // TODO: uncomment if we end up being kickoff by github + // done := c.rssThrottle() + // defer done() resp, err := c.httpClient.Get(releasesRSSURL) if err != nil {