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

Repocleaner : improve some output #2491

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Framework/script/RepoCleaner/qcrepocleaner/Ccdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def __init__(self, path: str, validFrom, validTo, createdAt, uuid=None, metadata
def __repr__(self):
if "Run" in self.metadata or "RunNumber" in self.metadata:
run_number = self.metadata["Run"] if "Run" in self.metadata else self.metadata["RunNumber"]
return f"Version of object {self.path} valid from {self.validFromAsDt}, run {run_number} (uuid {self.uuid})"
return f"Version of object {self.path} created at {self.createdAtDt.strftime('%Y-%m-%d %H:%M:%S')}, valid from {self.validFromAsDt.strftime('%Y-%m-%d %H:%M:%S')}, run {run_number} (uuid {self.uuid})"
else:
return f"Version of object {self.path} valid from {self.validFromAsDt} (uuid {self.uuid}, " \
return f"Version of object {self.path} created at {self.createdAtDt.strftime('%Y-%m-%d %H:%M:%S')}, valid from {self.validFromAsDt.strftime('%Y-%m-%d %H:%M:%S')} (uuid {self.uuid}, " \
f"ts {self.validFrom})"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def downloadConfigFromConsul(consul_url: str, consul_port: str, file_name: str):
:return: the path to the config file
"""

logging.debug("Get it from consul")
logging.debug(f"Download config file from consul : {consul_url} {consul_port} {file_name}")
consul_server = consul.Consul(host=consul_url, port=consul_port)
file_path = 'o2/components/qc/ANY/any/' + file_name
index, data = consul_server.kv.get(key=file_path)
Expand Down Expand Up @@ -393,7 +393,7 @@ def run(args, ccdb_url, rules):
logging.info(f" *** DONE *** (total deleted: {ccdb.counter_deleted}, total updated: {ccdb.counter_validity_updated})")
message = datetime.today().strftime('%Y-%m-%d-%H:%M:%S')
storeCrucialLog(message + f" - End of the cleaner (total deleted: {ccdb.counter_deleted}, total updated: {ccdb.counter_validity_updated})")
if not args.dry_run:
if not args.dry_run and not args.ignore_last_execution:
storeSavedTimestamp()

# ****************
Expand Down
6 changes: 4 additions & 2 deletions Framework/script/RepoCleaner/qcrepocleaner/rules/skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ def process(ccdb: Ccdb, object_path: str, delay: int, from_timestamp: int, to_t
'''

logger.debug(f"Plugin 'skip' processing {object_path}")

return {"deleted" : 0, "preserved": 0}

versions = ccdb.getVersionsList(object_path)

return {"deleted": 0, "preserved": len(versions), "updated": 0}


def main():
Expand Down