Skip to content

Accept multiple download ids and expire all queued option #78#79

Merged
patrick-austin merged 25 commits into36_queuingfrom
78_multiple_download_ids
Apr 2, 2025
Merged

Accept multiple download ids and expire all queued option #78#79
patrick-austin merged 25 commits into36_queuingfrom
78_multiple_download_ids

Conversation

@patrick-austin
Copy link

Closes #78

patrick-austin and others added 18 commits January 2, 2025 14:09
Use timeout, actual ICAT ids and Long.equals in UserResourceTest #35
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.2.12 to 1.2.13.
- [Commits](qos-ch/logback@v_1.2.12...v_1.2.13)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…gback-logback-classic-1.2.13

Bump ch.qos.logback:logback-classic from 1.2.12 to 1.2.13
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.1.7 to 1.2.13.
- [Commits](qos-ch/logback@v_1.1.7...v_1.2.13)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…/skeleton_plugin/ch.qos.logback-logback-classic-1.2.13

Bump ch.qos.logback:logback-classic from 1.1.7 to 1.2.13 in /provision/skeleton_plugin
Replace mysql:mysql-connector-java with com.mysql:mysql-connector-j
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](actions/cache@v2...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…actions/cache-4

Bump actions/cache from 2 to 4
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 1 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v1...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [nick-invision/assert-action](https://github.com/nick-invision/assert-action) from 1 to 2.
- [Release notes](https://github.com/nick-invision/assert-action/releases)
- [Changelog](https://github.com/nick-fields/assert-action/blob/main/.releaserc.js)
- [Commits](nick-fields/assert-action@v1...v2)

---
updated-dependencies:
- dependency-name: nick-invision/assert-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
"sessionId": session_id,
"queryOffset": "where download.id = " + download_id
}, verify=verifySsl).text)
download_ids = input("Enter download id(s): ")

Choose a reason for hiding this comment

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

As per the other PR, we should clarify what the separator is eg:
"Enter download id(s) - space separated if multiple:"

else:
for datafile_location in datafile_locations:
print(datafile_location)
download_ids = input("Enter download id(s): ")

Choose a reason for hiding this comment

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

As per the other PR, we should clarify what the separator is eg:
"Enter download id(s) - space separated if multiple:"



def expire_download():
download_ids = input("Enter download id(s): ")

Choose a reason for hiding this comment

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

As per the other PR, we should clarify what the separator is eg:
"Enter download id(s) - space separated if multiple:"

def start_queued_download():
download_id = input("Enter download id: ")
prepare_download(download_id=download_id)
download_ids = input("Enter download id(s): ")

Choose a reason for hiding this comment

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

As per the other PR, we should clarify what the separator is eg:
"Enter download id(s) - space separated if multiple:"

}
url = topcat_url + "/admin/download/" + download_id + "/status"
requests.put(url=url, data=data, verify=verifySsl)
download_ids = input("Enter download id(s): ")

Choose a reason for hiding this comment

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

As per the other PR, we should clarify what the separator is eg:
"Enter download id(s) - space separated if multiple:"

@@ -387,7 +406,8 @@ while True:
print(" * 10: Start a queued download.")

Choose a reason for hiding this comment

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

This should probably now be "Start queued download(s)." with this pattern being applied to all the other options that now accept multiple IDs.

print(" * 11: Start all queued downloads.")
print(" * 12: Re-queue expired download.")
print(" * 13: Exit")
print(" * 13: Expire all queued download.")

Choose a reason for hiding this comment

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

download needs to be downloads

@patrick-austin
Copy link
Author

Merged master to get the changes from #77 so I could refactor the id splitting to one place. This also means a lot of older commits showing on the diff here.

@patrick-austin
Copy link
Author

TestHelpers.createDummyDownload was creating DownloadItems for Datasets with ids hardcoded to 10, 11, 12. This is fine if any of the following are true:

  • Your Database is populated from scratch with ids starting at 1 before every test execution (this is the case for the CI)
  • You mock the IdsClient so that you never actually send a request to it (this is the case for the existing StatusCheckTest tests)
  • You use a "DummySessionId" as this will always cause an error, meaning we never reach the RESTORING state and assert for PREPARING instead (this was the case until the changes from Use functional credentials for prepareData queue calls to IDS #72 )

So after #72 the CI can get to RESTORING, but because of the first point my local tests still ended up in PREPARING as the IDS 404s when trying to look for Dataset 10 (since it doesn't exist in my local DB with that id). In general, I do not think we should hardcode these magic id numbers, so I tried removing that entire section from the Dummy Download function and all tests passed for me locally (i.e. nothing we were using the Dummy downloads for actually needed there to be DownloadItems set).

@patrick-austin patrick-austin merged commit 35c5c61 into 36_queuing Apr 2, 2025
1 check passed
@patrick-austin patrick-austin deleted the 78_multiple_download_ids branch April 2, 2025 12:38
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.

2 participants