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

Complete options for binary in/out and auth on/off #272

Closed
wants to merge 2 commits into from

Conversation

JAG-UK
Copy link
Contributor

@JAG-UK JAG-UK commented Oct 21, 2024

Fixes AB#10061
Fixes AB#10064

Fixes AB#10061
Fixes AB#10064

Signed-off-by: Jon Geater <[email protected]>
@JAG-UK
Copy link
Contributor Author

JAG-UK commented Oct 21, 2024

I have run the unit tests and the functests.
Functests made 4 failures, 1 is a duplicate Error which is a test bug, and the other 3 are 'payment required' for Locations which is harmless:

`---------------------------------------------------------------------------
ArchivistDuplicateError Traceback (most recent call last)
Cell In[12], line 3
1 # create an asset that matches the assets_filter field in the
2 # compliance policy.
----> 3 gringotts_vault = create_door(arch)
4 print("gringotts_vault", json_dumps(gringotts_vault, indent=4))

Cell In[7], line 6, in create_door(arch)
1 def create_door(arch):
2 """
3 Creates an Asset record to track a particular door.
4 """
----> 6 door, _ = arch.assets.create_if_not_exists(
7 {
8 "selector": [
9 {
10 "attributes": [
11 "arc_display_name",
12 "arc_display_type",
13 ]
14 },
15 ],
16 "behaviours": ASSET_BEHAVIOURS,
17 "attributes": {
18 "arc_display_name": "Gringott's Vault 2",
19 "arc_description": "Main door to the second level security vault in Gringott's Wizarding Bank",
20 "arc_display_type": "Vault Door",
21 },
22 },
23 )
24 print("DOOR:", json_dumps(door, indent=4))
25 return door

File ~/archivist/assets.py:232, in _AssetsRestricted.create_if_not_exists(self, data, confirm)
230 props, attrs = selector_signature(selector, data)
231 try:
--> 232 asset = self.read_by_signature(props=props, attrs=attrs)
234 except ArchivistNotFoundError:
235 LOGGER.info(
236 "asset with selector %s,%s does not exist - creating", props, attrs
237 )

File ~/archivist/assets.py:389, in _AssetsRestricted.read_by_signature(self, props, attrs)
375 """Read Asset by signature.
376
377 Reads asset that meets criteria. Only one asset is expected.
(...)
385
386 """
387 assets_label = f"public{ASSETS_LABEL}" if self._public else ASSETS_LABEL
388 return Asset(
--> 389 **self._archivist.get_by_signature(
390 self._label,
391 assets_label,
392 params=self.__params(props, attrs),
393 )
394 )

File ~/archivist/archivistpublic.py:385, in ArchivistPublic.get_by_signature(self, url, field, params, headers)
382 raise ArchivistNotFoundError("No entity found")
384 if len(records) > 1:
--> 385 raise ArchivistDuplicateError(f"{len(records)} found")
387 return records[0]

ArchivistDuplicateError: 2 found

======================================================================
ERROR: test_runner_door_entry (functests.execrunner.TestRunner)

Traceback (most recent call last):
File "/home/builder/functests/execrunner.py", line 155, in test_runner_door_entry
self.arch.runner.run_steps(parse_config(data=y))
File "/home/builder/archivist/runner.py", line 445, in run_steps
self.run_step(step)
File "/home/builder/archivist/runner.py", line 468, in run_step
response = s.execute()
File "/home/builder/archivist/runner.py", line 301, in execute
response = action(*self._args)
File "/home/builder/archivist/assets.py", line 248, in create_if_not_exists
loc, _ = self._archivist.locations.create_if_not_exists(
File "/home/builder/archivist/locations.py", line 156, in create_if_not_exists
return self.create_from_data(data), False
File "/home/builder/archivist/locations.py", line 109, in create_from_data
return Location(**self._archivist.post(self._label, data))
File "/home/builder/archivist/retry429.py", line 26, in wrapper
ret = f(*args, **kwargs)
File "/home/builder/archivist/archivist.py", line 281, in post
raise error
archivist.errors.ArchivistPaymentRequiredError: https://app.datatrails.ai/archivist/v2/locations: {"code":12, "message":"rpc error: code = Unimplemented desc = tenant/b84855fd-a3d3-414c-aab2-1929390bd3fc QuotaReached Locations: Payment Required", "details":[]} (402)

======================================================================
ERROR: test_runner_synsation (functests.execrunner.TestRunner)

Traceback (most recent call last):
File "/home/builder/functests/execrunner.py", line 100, in test_runner_synsation
self.arch.runner.run_steps(
File "/home/builder/archivist/runner.py", line 445, in run_steps
self.run_step(step)
File "/home/builder/archivist/runner.py", line 468, in run_step
response = s.execute()
File "/home/builder/archivist/runner.py", line 301, in execute
response = action(*self._args)
File "/home/builder/archivist/locations.py", line 156, in create_if_not_exists
return self.create_from_data(data), False
File "/home/builder/archivist/locations.py", line 109, in create_from_data
return Location(**self._archivist.post(self._label, data))
File "/home/builder/archivist/retry429.py", line 26, in wrapper
ret = f(*args, **kwargs)
File "/home/builder/archivist/archivist.py", line 281, in post
raise error
archivist.errors.ArchivistPaymentRequiredError: https://app.datatrails.ai/archivist/v2/locations: {"code":12, "message":"rpc error: code = Unimplemented desc = tenant/b84855fd-a3d3-414c-aab2-1929390bd3fc QuotaReached Locations: Payment Required", "details":[]} (402)

======================================================================
ERROR: test_runner_wipp (functests.execrunner.TestRunner)

Traceback (most recent call last):
File "/home/builder/functests/execrunner.py", line 191, in test_runner_wipp
self.arch.runner.run_steps(parse_config(data=y))
File "/home/builder/archivist/runner.py", line 445, in run_steps
self.run_step(step)
File "/home/builder/archivist/runner.py", line 468, in run_step
response = s.execute()
File "/home/builder/archivist/runner.py", line 301, in execute
response = action(*self._args)
File "/home/builder/archivist/events.py", line 351, in create_from_data
loc, _ = self._archivist.locations.create_if_not_exists(
File "/home/builder/archivist/locations.py", line 156, in create_if_not_exists
return self.create_from_data(data), False
File "/home/builder/archivist/locations.py", line 109, in create_from_data
return Location(**self._archivist.post(self._label, data))
File "/home/builder/archivist/retry429.py", line 26, in wrapper
ret = f(*args, **kwargs)
File "/home/builder/archivist/archivist.py", line 281, in post
raise error
archivist.errors.ArchivistPaymentRequiredError: https://app.datatrails.ai/archivist/v2/locations: {"code":12, "message":"rpc error: code = Unimplemented desc = tenant/b84855fd-a3d3-414c-aab2-1929390bd3fc QuotaReached Locations: Payment Required", "details":[]} (402)


Ran 69 tests in 189.523s

FAILED (errors=4, skipped=8)
`

@JAG-UK
Copy link
Contributor Author

JAG-UK commented Oct 23, 2024

The non-JSON return support actually has nasty tentacles. Abandoning this, will put up separate PRs for the 2 separate issues

@JAG-UK JAG-UK closed this Oct 23, 2024
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.

1 participant