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

Parsing date-time string for pipeline.completed_on failing due to strftime issue. #1372

Open
CrispyCB opened this issue Apr 17, 2024 · 0 comments

Comments

@CrispyCB
Copy link

Traceback (most recent call last):
  File "/opt/atlassian/pipelines/agent/build/pipelineAuditHandler.py", line 84, in <module>
    audit_repositories(selectquote, fintech_repo_list)
  File "/opt/atlassian/pipelines/agent/build/pipelineAuditHandler.py", line 61, in audit_repositories
Repository found: fintech-ui
    f"{nickname} ran a {state} pipeline against {pipeline.data['target']['ref_name']} in {repo.name} on {pipeline.completed_on}.\n"
  File "/usr/local/lib/python3.10/site-packages/atlassian/bitbucket/cloud/repositories/pipelines.py", line 139, in completed_on
    return self.get_time("completed_on")
  File "/usr/local/lib/python3.10/site-packages/atlassian/bitbucket/base.py", line 167, in get_time
    value = datetime.strptime(value_str, self.CONF_TIMEFORMAT)
  File "/usr/local/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.10/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2024-04-10T20:16:48.914706353Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'

Attempting to parse pipeline.completed_on (or any date-time string, I assume) fails with the above error.

Steps to recreate:

  1. Get a single Atlassian pipeline run.
  2. Print its completed_on value.
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

No branches or pull requests

1 participant