Skip to content
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

Throttle Logs Endpoint from CLI #1734

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Throttle Logs Endpoint from CLI #1734

merged 1 commit into from
Sep 23, 2024

Conversation

amandeepsingh333
Copy link
Contributor

problem :
if large number(500) of snapshots are failing or have some issues for the customer then we are causing Rate limiting to get triggered on api/v1/suggestions/from_logs as we fetch suggestions for all snapshots. This triggers alert on our side.

approach:
To tackle this we have CLI in a way that we dont ask for more than 10 suggestions per build. We are basically limiting the maximum suggestions we can suggest per build. The idea is that if all snapshots are getting some suggestions in build they would be probably same.

implementation:
we have stored a counter of suggestionsCalls and will stop the call to end the count is > 10.

]));
});

it('should not call getErrorAnalysis after exceeding the rate limit', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you update this case for checking multiple logs are not getting printed if we cross threshold

@amandeepsingh333 amandeepsingh333 merged commit d96c134 into master Sep 23, 2024
36 checks passed
@amandeepsingh333 amandeepsingh333 deleted the PPLT_3337 branch September 23, 2024 14:52
Amit3200 pushed a commit that referenced this pull request Sep 29, 2024
chinmay-browserstack pushed a commit that referenced this pull request Sep 30, 2024
* Fixed cookies parsing bug (#1727)

* v1.29.4-beta.3 (#1729)

* adding secure flag for cookies that starts with __Secure (#1730)

* releasing v1.29.4-beta.4 (#1731)

* updating path-to-regexp to 6.3.0 where the vulnerabilities are fixed (#1733)

* releasing v1.29.4-beta.5 (#1735)

* ⬆️ Bump micromatch from 4.0.7 to 4.0.8 (#1706)

Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/micromatch@4.0.7...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump @babel/preset-env from 7.19.4 to 7.25.4 (#1704)

Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.4 to 7.25.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.25.4/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump axios from 1.6.7 to 1.7.7 (#1737)

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.7.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.7)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump body-parser from 1.19.0 to 1.20.3 (#1720)

Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.19.0 to 1.20.3.
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](expressjs/body-parser@1.19.0...1.20.3)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump eslint-plugin-import from 2.29.1 to 2.30.0 (#1740)

Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.29.1 to 2.30.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.29.1...v2.30.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️👷 Bump github/codeql-action from 3.25.10 to 3.26.8 (#1741)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.10 to 3.26.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@23acc5c...294a9d9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: packages/core/package.json to reduce vulnerabilities (#1732)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MICROMATCH-6838728

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* ⬆️ Bump tsd from 0.28.1 to 0.31.2 (#1738)

Bumps [tsd](https://github.com/tsdjs/tsd) from 0.28.1 to 0.31.2.
- [Release notes](https://github.com/tsdjs/tsd/releases)
- [Commits](tsdjs/tsd@v0.28.1...v0.31.2)

---
updated-dependencies:
- dependency-name: tsd
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Throttle Logs Endpoint from CLI (#1734)

* v1.29.4-beta.6 (#1742)

* Multi DOM Capture JS-utils

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ninadbstack <60422475+ninadbstack@users.noreply.github.com>
Co-authored-by: Pradum Kumar <pradumraj360@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AgnellusX1 <43168803+AgnellusX1@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Amandeep singh <amandeep@browserstack.com>
chinmay-browserstack added a commit that referenced this pull request Sep 30, 2024
…in single asset discovery phase (#1728)

* [Defer Uploads v2] Added support for handling multiple root resource in single asset discovery phase

* update domSnapshot structure in config + reload page in case on multidom

* Fix test

* Added tests for widths endpoint + multiple root resources

* add multi dom case

* Added case for percyCSS with multiple root resource

* Remove extra code and improve coverage

* Fix coverage

* Coverage resolved

* Addressed comments

* Minor improvement

* Addressed comments

* wait for page navigation while force reloading

* Updated test to have different resource in different doms

* Add logging for test browser userAgent

* Fix tests

* Change userAgent condition for responsiveSnapshotCapture

* Added test endpoint for changing widths

* Added waitForResize script

* Add flag for changing config in test api

* Added tests for waitForResize

* Added defer uploads option in test config endpoint

* Responsive DOM SDK Utils (#1746)

* Fixed cookies parsing bug (#1727)

* v1.29.4-beta.3 (#1729)

* adding secure flag for cookies that starts with __Secure (#1730)

* releasing v1.29.4-beta.4 (#1731)

* updating path-to-regexp to 6.3.0 where the vulnerabilities are fixed (#1733)

* releasing v1.29.4-beta.5 (#1735)

* ⬆️ Bump micromatch from 4.0.7 to 4.0.8 (#1706)

Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/micromatch@4.0.7...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump @babel/preset-env from 7.19.4 to 7.25.4 (#1704)

Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.4 to 7.25.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.25.4/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump axios from 1.6.7 to 1.7.7 (#1737)

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.7.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.7)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump body-parser from 1.19.0 to 1.20.3 (#1720)

Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.19.0 to 1.20.3.
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](expressjs/body-parser@1.19.0...1.20.3)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump eslint-plugin-import from 2.29.1 to 2.30.0 (#1740)

Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.29.1 to 2.30.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.29.1...v2.30.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️👷 Bump github/codeql-action from 3.25.10 to 3.26.8 (#1741)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.10 to 3.26.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@23acc5c...294a9d9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: packages/core/package.json to reduce vulnerabilities (#1732)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MICROMATCH-6838728

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* ⬆️ Bump tsd from 0.28.1 to 0.31.2 (#1738)

Bumps [tsd](https://github.com/tsdjs/tsd) from 0.28.1 to 0.31.2.
- [Release notes](https://github.com/tsdjs/tsd/releases)
- [Commits](tsdjs/tsd@v0.28.1...v0.31.2)

---
updated-dependencies:
- dependency-name: tsd
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Throttle Logs Endpoint from CLI (#1734)

* v1.29.4-beta.6 (#1742)

* Multi DOM Capture JS-utils

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ninadbstack <60422475+ninadbstack@users.noreply.github.com>
Co-authored-by: Pradum Kumar <pradumraj360@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AgnellusX1 <43168803+AgnellusX1@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Amandeep singh <amandeep@browserstack.com>

* Handle case when cookie is passed as object from sdk

* Remove unnecessary fields from cookies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Amit Singh Sansoya <tusharamit@yahoo.com>
Co-authored-by: ninadbstack <60422475+ninadbstack@users.noreply.github.com>
Co-authored-by: Pradum Kumar <pradumraj360@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AgnellusX1 <43168803+AgnellusX1@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Amandeep singh <amandeep@browserstack.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants