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

[Bug]: filename containing invalid characters to be used as docker image name #1069

Closed
sonichi opened this issue Dec 27, 2023 · 1 comment · Fixed by #1127
Closed

[Bug]: filename containing invalid characters to be used as docker image name #1069

sonichi opened this issue Dec 27, 2023 · 1 comment · Fixed by #1127
Assignees

Comments

@sonichi
Copy link
Contributor

sonichi commented Dec 27, 2023

Describe the bug

https://github.com/microsoft/autogen/actions/runs/7338570361/job/19981290015?pr=925

The first line in the python block is:
# filename: inequality.py (you can choose your own filename)
The filename is parsed as inequality.py (you can choose your own filename) by:

filename = code[11 : code.find("\n")].strip()

It then causes the error in
tag = filename.replace("/", "")
container.commit(repository="python", tag=tag)

Steps to reproduce

call
execute_code(filename="inequality.py (you can choose your own filename", use_docker=True, code="")

Expected Behavior

An error like https://github.com/microsoft/autogen/actions/runs/7338570361/job/19981290015?pr=925 should occur
at

tag = filename.replace("/", "")
container.commit(repository="python", tag=tag)

Screenshots and logs

https://github.com/microsoft/autogen/actions/runs/7338570361/job/19981290015?pr=925

Additional Information

AutoGen Version: 0.2.2

@sonichi sonichi added the bug label Dec 27, 2023
@ekzhu
Copy link
Collaborator

ekzhu commented Jan 2, 2024

Related to #1095. The input filename should be validated and the docker image name should be validated

@ekzhu ekzhu self-assigned this Jan 3, 2024
ekzhu added a commit that referenced this issue Jan 3, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 13, 2024
… (#1127)

* fix #1069

* uncomment skips

* use importlib to check package

* better code

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
joshkyh pushed a commit that referenced this issue Jan 17, 2024
… (#1127)

* fix #1069

* uncomment skips

* use importlib to check package

* better code

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
whiskyboy pushed a commit to whiskyboy/autogen that referenced this issue Apr 17, 2024
…rosoft#1069 (microsoft#1127)

* fix microsoft#1069

* uncomment skips

* use importlib to check package

* better code

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
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 a pull request may close this issue.

2 participants