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

Uses newest scoring timestamp as etag header #472

Merged

Conversation

alecharp
Copy link
Collaborator

Description

Closes #373.

Not all scores are computed all the time. For a score to be computed again on a plugin, probe results on the plugin have to be updated (more recent than last execution of the score) and the scoring implementation must have the same version as on its last execution.

Because of that, we know that the most recent score computed, across all the plugins, will determine if the content of the /scores/api has changed since the last time it was fetched.

This puts the value of the seconds since epoch of the most recent scoring execution in the ETag header of the response.

Testing done

Adjusted the unit test on the API to validate the presence and value of the ETag header.

Submitter checklist

@alecharp alecharp added the enhancement New feature or request label Feb 22, 2024
lemeurherve
lemeurherve previously approved these changes Feb 23, 2024
@alecharp
Copy link
Collaborator Author

@lemeurherve is that enough or should we have something in front of the /scores/api interface to cache the response and "keep" the data as long as it's not changed?

@lemeurherve
Copy link
Member

I don't know.

@lemeurherve
Copy link
Member

lemeurherve commented Feb 23, 2024

I definitively would be in favor of a static export of everything like it's done for other sources of data for plugin-site instead of an API, but that's a discussion not directly related to this PR.

@lemeurherve
Copy link
Member

lemeurherve commented Feb 23, 2024

I definitively would be in favor of a static export of everything like it's done for other sources of data for plugin-site instead of an API, but that's a discussion not directly related to this PR.

Looking again at the linked issue, that's in fact related.

#373 is about having a static export in https://reports.jenkins.io instead of an API to pass data to plugin-site.

@lemeurherve lemeurherve dismissed their stale review February 23, 2024 14:11

don't resolve the issue as I intended initially

Locally, this makes the original 6.9MB shrinks to 3.5MB file.
alecharp and others added 3 commits February 26, 2024 16:41
Co-Authored-By: Hervé Le Meur <lemeurherve.jenkins@gmail.com>
Co-Authored-By: Hervé Le Meur <lemeurherve.jenkins@gmail.com>
Co-Authored-By: Hervé Le Meur <lemeurherve.jenkins@gmail.com>
@alecharp alecharp merged commit 4b9657a into jenkins-infra:main Mar 5, 2024
19 checks passed
@alecharp alecharp deleted the feature/uses-etag-header-for-scoring-api branch March 5, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put in place a periodic export of scores to be consumed by plugin-site
2 participants