Skip to content

FAI-15182 | CircleCI optimization for tests stream API calls #1928

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
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dbruno21
Copy link
Contributor

@dbruno21 dbruno21 commented Feb 27, 2025

Description

Prevent calling the same API calls for pipelines and tests streams (both call pipelines -> workflows -> jobs). Memoization was removed on #1918 to prevent OOM issues. It was thought to not be used, but it was useful after all (memoize by default uses only the first function param as key).

This change stores, when the pipelines stream runs, just the necessary jobs data to be used later on the tests stream.

Type of change

  • Bug fix
  • New feature
  • Breaking change

Related issues

Fix #1

Migration notes

Describe migration notes if any

Extra info

Add any additional information

@dbruno21
Copy link
Contributor Author

@chalenge wdyt?

For better PR readability, hide whitespace from diff
image

@dbruno21 dbruno21 marked this pull request as ready for review February 28, 2025 14:08
@dbruno21 dbruno21 requested a review from chalenge February 28, 2025 14:08
Copy link
Contributor

@chalenge chalenge left a comment

Choose a reason for hiding this comment

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

Looks fine, see comment

}
}

getUpdatedState(
Copy link
Contributor

Choose a reason for hiding this comment

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

we no longer need state?

Copy link
Contributor Author

@dbruno21 dbruno21 Feb 28, 2025

Choose a reason for hiding this comment

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

On the connector version using memoize, the memoized values corresponds to the pipelines stream state (the one that was used for making the API calls 1 2). So even if it's needed it wasn't being used.

In theory on a successful sync, this state would end up matching with the one saved on the pipelines stream. The only problem is that if a sync breaks before finishing the tests stream. The state for pipelines stream will be already saved, losing tests records. Not sure how to handle that case. I decided to do this instead of combining the streams, because it seemed faster and easier, but it has this problem (that also happens with the memoized version)

Copy link

sonarqubecloud bot commented Mar 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants