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

jf rt build-append fails if already uploaded build info uses time zone Z #2823

Open
Ext3h opened this issue Jan 8, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Ext3h
Copy link

Ext3h commented Jan 8, 2025

Describe the bug

jf rt build-append is unable to correctly parse the time zone designator Z as required by ISO 8601, evenn though Artifactory has accepted build specs with this designator in the started header field as valid.

It is only accepting the +hhmm syntax, and rejecting any other.

Current behavior

+ jf rt build-append jf_job 1 conan_job 1
15:27:16 [Info] Running Build Append command...
15:27:16 [Error] parsing time "2025-01-08T14:37:22.000Z" as "2006-01-02T15:04:05.000-0700": cannot parse "Z" as "-0700"

Reproduction steps

Conan has produced a build info of the following form, and Artifactory has accepted it as valid:

{
    "version": "1.0.1",
    "name": "conan_job",
    "number": "1",
    "buildAgent": {
        "name": "conan",
        "version": "1.59.0"
    },
    "started": "2025-01-08T14:37:22.000Z",
    "durationMillis": 0,
    "artifactoryPrincipal": "foo",
    "modules": []
}

Trying to reference this build in jf rt build-append fails:

+ jf rt build-append jf_job 1 conan_job 1
15:27:16 [Info] Running Build Append command...
15:27:16 [Error] parsing time "2025-01-08T14:37:22.000Z" as "2006-01-02T15:04:05.000-0700": cannot parse "Z" as "-0700"

Expected behavior

started headers in UTC time zone are correctly accepted.

JFrog CLI version

2.48.0, 2.62.1, 2.73.0

Operating system type and version

Ubuntu 1804, Ubuntu 2204. Windows Server 2022

JFrog Artifactory version

7.98.13

JFrog Xray version

No response

@Ext3h Ext3h added the bug Something isn't working label Jan 8, 2025
@Ext3h
Copy link
Author

Ext3h commented Jan 8, 2025

Problem is in https://github.com/jfrog/build-info-go/blob/main/entities/buildinfo.go#L20 - ISO 8601 conforming timestamp parsing requires Z0700 instead of -0700 for the time zone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant