Skip to content

Bump pyscript#15

Merged
ioggstream merged 3 commits into
mainfrom
ioggstream-14
Jan 8, 2026
Merged

Bump pyscript#15
ioggstream merged 3 commits into
mainfrom
ioggstream-14

Conversation

@ioggstream
Copy link
Copy Markdown
Contributor

No description provided.

@ioggstream ioggstream requested a review from Copilot June 11, 2025 13:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Bumps pyscript assets to version 2025.3.1, introduces a custom Element class for DOM manipulation and refactors event handling, and applies updates across Kubernetes name encoding, CLI argument handling, and Mermaid tree rendering.

  • Updated pyscript CSS/JS references in docs/mermaid.html
  • Added Element class in docs/app.py and refactored event_listener
  • URL-encoded Kubernetes resource names, enforced required CLI args, and refined namespace ordering in Mermaid output

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/mermaid.html Updated pyscript links; imported Element for use in snippets
docs/app.py Defined Element class; refactored event_listener to use js
d3fendtools/kuberdf/base.py Added URL-encoding of name via urllib.parse.quote
d3fendtools/as_mermaid/main.py Made input files argument required in CLI
d3fendtools/as_mermaid/init.py Added K8S.Service; enhanced create_tree to defer namespaces
Comments suppressed due to low confidence (1)

docs/app.py:242

  • [nitpick] The event_listener decorator bypasses the new Element class and directly uses js.document; consider using the Element API or removing the unused Element import for consistency.
Element(element_id).element.addEventListener(event_type, create_proxy(callback))

Comment thread docs/mermaid.html
from pyodide.ffi import create_proxy
import js

from app import Element
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider consolidating the import of Element and the import of the app module: you could reference app.Element instead of importing Element separately to reduce redundancy.

Suggested change
from app import Element

Copilot uses AI. Check for mistakes.
self.kind = manifest["kind"]
self.metadata = manifest["metadata"]
self.name = self.metadata["name"]
from urllib.parse import quote
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

Consider moving the urllib.parse.quote import to the top of the module to avoid repeated imports inside init and improve readability.

Suggested change
from urllib.parse import quote

Copilot uses AI. Check for mistakes.
Comment thread d3fendtools/as_mermaid/__main__.py Outdated

@click.command()
@click.argument("files", nargs=-1, type=click.Path(exists=True))
@click.argument("files", nargs=-1, type=click.Path(exists=True), required=True)
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

click.argument does not support a required=True parameter, which will cause a runtime error. To enforce at least one file, validate the 'files' list in the command body or use nargs=1+.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

if child == parent:
continue
if parent_type == K8S.Namespace:
if (is_namespace, parent_type) == (False, K8S.Namespace):
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The tuple comparison for namespace handling is non-intuitive; consider rewriting as if not is_namespace and parent_type == K8S.Namespace to express intent more clearly.

Suggested change
if (is_namespace, parent_type) == (False, K8S.Namespace):
if not is_namespace and parent_type == K8S.Namespace:

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 8, 2026

@ioggstream I've opened a new pull request, #17, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Fix click.argument usage by removing required=True and adding validation

Co-authored-by: ioggstream <1140844+ioggstream@users.noreply.github.com>

* Add required=True to --output option to prevent None value

Co-authored-by: ioggstream <1140844+ioggstream@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ioggstream <1140844+ioggstream@users.noreply.github.com>
@ioggstream ioggstream merged commit fafe5da into main Jan 8, 2026
1 of 5 checks passed
@ioggstream ioggstream deleted the ioggstream-14 branch January 8, 2026 17: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.

3 participants