Skip to content

Extractor timing fixes#180

Open
jaimeib wants to merge 4 commits into
masterfrom
extractor_timing_fixes
Open

Extractor timing fixes#180
jaimeib wants to merge 4 commits into
masterfrom
extractor_timing_fixes

Conversation

@jaimeib
Copy link
Copy Markdown
Member

@jaimeib jaimeib commented Mar 20, 2026

This pull request updates how the lastrun file is written in the caso.extract.manager module, ensuring that the timestamp reflects the end of the extraction window rather than the current time. It also updates related tests.

Changes to lastrun file logic:

  • The write_lastrun method now takes an additional extract_to argument and writes extract_to + 1 second as the lastrun timestamp, instead of the current time, ensuring more accurate tracking of extraction windows.
  • The get_records method is updated to pass the extract_to value to write_lastrun, aligning the lastrun file with the extraction period.

Test updates:

  • The test_write_lastrun_dry_run test is updated to check that write_lastrun is called with both the project and the extraction end time, reflecting the new method signature.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@756417c). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #180   +/-   ##
=========================================
  Coverage          ?   58.55%           
=========================================
  Files             ?       25           
  Lines             ?     1402           
  Branches          ?      136           
=========================================
  Hits              ?      821           
  Misses            ?      559           
  Partials          ?       22           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread caso/extract/manager.py Outdated

from keystoneauth1.exceptions.catalog import EmptyCatalog
from keystoneauth1.exceptions.http import Forbidden
from caso import keystone_client, loading
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.

Why all this reordering?

Comment thread caso/extract/manager.py Outdated

def write_lastrun(self, project):
def write_lastrun(self, project, extract_to):
"""Write a lastrun file for a given project."""
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.

I would document the new behaviour here.

jaimeib added 2 commits March 23, 2026 11:50
Updated docstring for write_lastrun method to clarify the purpose of the extract_to parameter and its role in the ingestion process.
@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants