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

Handle undefined state entries #1623

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Conversation

jelly
Copy link
Member

@jelly jelly commented Mar 15, 2024

The dynamiclistform only grows and removes entries by setting them to undefined which we need to account for. Previously this would map() and return [undefined, obj] but that raises an exception when you call Object.keys(undefined).

Fixes #1619

The dynamiclistform only grows and removes entries by setting them to
undefined which we need to account for. Previously this would map() and
return [undefined, obj] but that raises an exception when you call
Object.keys(undefined).

Fixes cockpit-project#1619
@jelly jelly requested a review from martinpitt March 15, 2024 11:44
@jelly jelly marked this pull request as ready for review March 15, 2024 11:44
@jelly
Copy link
Member Author

jelly commented Mar 15, 2024

There are some things I want to fix in a follow up:

#1622 (comment)

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Ah, I remember that pain in machines. Thanks!

fedora/rawhide is known broken (containers/podman#21896), but the others should work, retrying.

@jelly
Copy link
Member Author

jelly commented Mar 15, 2024

Ah, I remember that pain in machines. Thanks!

fedora/rawhide is known broken (containers/podman#21896), but the others should work, retrying.

There is some serious nonsense going on here, I had to add that podman inspect as waiting on the container to appear breaks the test because it opens the "Create container modal" too fast. This is very annoying imo, especially because waiting for a container to be "Running" requires doing an inspect with waitContainer

Killing browser (pid 665418)
Traceback (most recent call last):
  File "/home/jelle/projects/cockpit-podman/./test/check-application", line 2393, in testCreateContainerValidation
    b.click(f'#containers-images tbody tr:contains("{IMG_BUSYBOX}") .ct-container-create')
  File "/home/jelle/projects/cockpit-podman/test/common/testlib.py", line 412, in click
    self.mouse(selector + ":not([disabled]):not([aria-disabled=true])", "click", 0, 0, 0)
  File "/home/jelle/projects/cockpit-podman/test/common/testlib.py", line 405, in mouse
    self.call_js_func('ph_mouse', selector, event, x, y, btn, ctrlKey, shiftKey, altKey, metaKey)
  File "/home/jelle/projects/cockpit-podman/test/common/testlib.py", line 358, in call_js_func
    return self.eval_js("%s(%s)" % (func, ','.join(map(jsquote, args))))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jelle/projects/cockpit-podman/test/common/testlib.py", line 336, in eval_js
    result = self.cdp.invoke("Runtime.evaluate", expression=code, trace=code,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jelle/projects/cockpit-podman/test/common/cdp.py", line 204, in invoke
    res = self.command(cmd)
          ^^^^^^^^^^^^^^^^^
  File "/home/jelle/projects/cockpit-podman/test/common/cdp.py", line 231, in command
    raise RuntimeError(res["error"])
RuntimeError: TypeError: Converting circular structure to JSON

@jelly jelly merged commit 4f33683 into cockpit-project:main Mar 15, 2024
29 of 30 checks passed
@jelly jelly deleted the env-undefined-keys branch March 15, 2024 13:40
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.

Removing Environment variables when creating a container breaks validation
2 participants