Skip to content

Adding an optional mechanism for reducing the frequency of lastApiUseTime updates - #12866

Open
landreev wants to merge 1 commit into
developfrom
12809-delay-updating-lastapiuse
Open

landreev wants to merge 1 commit into
developfrom
12809-delay-updating-lastapiuse

Conversation

@landreev

@landreev landreev commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Please see #12809, it's fairly straightforward.

Which issue(s) this PR closes:

Special notes for your reviewer:

The logic that decides whether to proceed with updating the timestamp or not is within a method with a "requires new" transaction attribute. Meaning there will always be, at least an empty, extra transaction after every call. Like most of the PR, this was an ai-recommended solution. With the following rationale provided:

updateLastApiUseTime() still has REQUIRES_NEW, so a skipped update still starts and ends a transaction. Nothing touches the database in that transaction, so it should cost very little. Avoiding it entirely would mean moving the check into the three callers.

Which seemed reasonable to me.

Suggestions on how to test this:

Enable the feature flag (see the accompanying docs); run some api methods with valid API tokens of different users. Check the lastApiUseTime in the AuthenticatedUser table, with and without a specific (non-default) refresh interval configured.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

yes. included.

Additional documentation:

…ps when older than a configurable time interval. #12809
@landreev landreev moved this to Ready for Triage in IQSS Dataverse Project Nov 3, 2026
@landreev landreev added the Size: 3 A percentage of a sprint. 2.1 hours. label Nov 3, 2026
@landreev landreev added this to the 6.13 milestone Nov 3, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 25.668% — 12809-delay-updating-lastapiuse into develop. No base build found for develop.

@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
68.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:12809-delay-updating-lastapiuse
ghcr.io/gdcc/configbaker:12809-delay-updating-lastapiuse

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Test Results

417 tests  ±0   403 ✅ ±0   31m 24s ⏱️ -30s
 59 suites ±0    14 💤 ±0 
 59 files   ±0     0 ❌ ±0 

Results for commit 3d3000a. ± Comparison against base commit 3cbdeab.

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me!

@github-project-automation github-project-automation Bot moved this from Ready for Triage to Ready for QA ⏩ in IQSS Dataverse Project Nov 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Ready for QA ⏩

Development

Successfully merging this pull request may close these issues.

Make it possible to NOT have to update the lastApiUse timestamp after every call

3 participants