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

UrlUpdater changes both error and success timestamp #1343

Closed
hohwille opened this issue Aug 31, 2023 · 0 comments · Fixed by #1347
Closed

UrlUpdater changes both error and success timestamp #1343

hohwille opened this issue Aug 31, 2023 · 0 comments · Fixed by #1347
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hohwille
Copy link
Member

Expected behavior

The UrlUpdater (update-urls.yml) should update status.json in the following ways:

  • If a download verification failed and resulted in an error, then this should be set in the according error section (current error HTTP status code and timestamp of now) if the previous error timestamp is older than the success timestamp.
  • If a download verification succeeded and its previous success timestamp is older than its error timestamp (download error went away), then the success timestamp should be updated to now.

Actual behavior

There is total non-sense happening. See e.g. this commit where both success and error timestamps have been set to the exact same instant of time. At one moment of time the state can either be error or success but not both. The fun fact and the actual reason seems to lay in the error status code that is set to 200:

"urls" : {
    "202695819" : {
      "success" : {
        "timestamp" : "2023-08-30T03:35:35.531458481Z"
        "timestamp" : "2023-08-31T03:41:43.706649707Z"
      },
      "error" : {
        "timestamp" : "2023-08-30T03:35:35.651600276Z",
        "timestamp" : "2023-08-31T03:41:43.840025356Z",
        "code" : 200
      }
    },

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. check this status.json:
    https://github.com/devonfw/ide-urls/blob/055a0285b38376ea49f612ac4e60eeb75c74e817/pip/pip/3.2/status.json#L10

Related/Dependent Issues

Comments/Hints:

Maybe we broke that code that determines if something is success or error from the response.

Affected version:

  • current UrlUpdater code
@hohwille hohwille added the bug Something isn't working label Aug 31, 2023
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 4, 2023
added a test for a proper status.json refresh
added new UrlUpdaterMockSingle class
adjusted javadocs in UrlUpdaterMock classes
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 4, 2023
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 5, 2023
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 14, 2023
added new isValidContentType method to AbstractUrlUpdater (workaround for pip returning text/plain)
added PipUrlUpdaterTest and mock
adjusted test in UrlUpdaterTest to simulate bug in UrlUpdater
moved getStatusJson method to AbstractUrlUpdaterTest
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 14, 2023
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 18, 2023
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 18, 2023
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 18, 2023
adjusted javadocs
fixed package name
@jan-vcapgemini jan-vcapgemini self-assigned this Sep 19, 2023
@jan-vcapgemini jan-vcapgemini modified the milestones: nice-to-have, internal Sep 19, 2023
jan-vcapgemini added a commit to jan-vcapgemini/ide that referenced this issue Sep 19, 2023
improved getStatusJson test method
refactored PipUrlUpdaterTest
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

Successfully merging a pull request may close this issue.

2 participants