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

checkers: ability to replace timestamp #297

Merged
merged 2 commits into from
Apr 30, 2022
Merged

checkers: ability to replace timestamp #297

merged 2 commits into from
Apr 30, 2022

Conversation

catsout
Copy link
Contributor

@catsout catsout commented Apr 29, 2022

add 'timestamp' parameter to _update_version, for jsonchecker using timestamp from json rather than using the one from url response date.

Fix for tarballs from GitHub.

Example:

    sources:
      - type: archive
        url: https://github.com/laurent22/joplin/archive/v2.8.4.tar.gz
        sha256: d039577ecc1e7589e7432f45d4e12308d16b5df0c1b0cc928bc451d8136761d4
        x-checker-data:
          type: json
          url: https://api.github.com/repos/laurent22/joplin/releases
          version-query: .[0] | .tag_name | sub("^v"; "")
          url-query: '"https://github.com/laurent22/joplin/archive/v" + $version +
            ".tar.gz"'
          timestamp-query: .[0] | .published_at

@wjt
Copy link
Contributor

wjt commented Apr 29, 2022

Please could you add a test and update the documentation in README.md?

@wjt wjt requested a review from gasinvein April 29, 2022 08:33
Copy link
Collaborator

@gasinvein gasinvein left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this.
Please split changes to checkers and jsonchecker into different commits (changes to tests should go into the same commit that has added changes being tested).

README.md Outdated Show resolved Hide resolved
add 'timestamp' parameter to _update_version
tests/test_jsonchecker.py Outdated Show resolved Hide resolved
tests/io.github.stedolan.jq.yml Outdated Show resolved Hide resolved
Also using provided timestamp on non-git type sources, the one from url
response date will be replaced.
New test case.
@catsout
Copy link
Contributor Author

catsout commented Apr 30, 2022

BTW, ./run-in-container.sh python3 -m unittest discover is not working on my machine.

@vchernin
Copy link
Contributor

BTW, ./run-in-container.sh python3 -m unittest discover is not work on my machine.

#275 fixes it

Copy link
Collaborator

@gasinvein gasinvein left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@gasinvein gasinvein merged commit 4b2a4f3 into flathub-infra:master Apr 30, 2022
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.

4 participants