Skip to content

feat: add local file and dir uploads configuration#29

Open
a-dubs wants to merge 2 commits intocanonical:mainfrom
a-dubs:add-local-upload-config
Open

feat: add local file and dir uploads configuration#29
a-dubs wants to merge 2 commits intocanonical:mainfrom
a-dubs:add-local-upload-config

Conversation

@a-dubs
Copy link
Copy Markdown

@a-dubs a-dubs commented Jan 28, 2025

No description provided.

@a-dubs a-dubs force-pushed the add-local-upload-config branch from 46f41a3 to 37e27f9 Compare January 28, 2025 15:03
Copy link
Copy Markdown
Collaborator

@rpocase rpocase left a comment

Choose a reason for hiding this comment

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

  • can we add unit tests
  • are there exceptional cases we should consider as part of this implementation? what errors could we catch to better help the user?

@a-dubs a-dubs marked this pull request as draft January 28, 2025 15:39
Copy link
Copy Markdown
Collaborator

@toabctl toabctl left a comment

Choose a reason for hiding this comment

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

  • needs unittests
  • needs functional tests
  • needs documentation

@a-dubs
Copy link
Copy Markdown
Author

a-dubs commented Jan 29, 2025

@toabctl I know I know I marked this as WIP, I just wanted to know if this is something you think is worth adding before proceeding to put time into finalizing this work.

@toabctl
Copy link
Copy Markdown
Collaborator

toabctl commented Jan 29, 2025

@toabctl I know I know I marked this as WIP, I just wanted to know if this is something you think is worth adding before proceeding to put time into finalizing this work.

yes! I would really like to see that added. this is also on the TODO list (please drop it from there if you've implemented it).

Comment thread chimg/config.py Outdated
@a-dubs
Copy link
Copy Markdown
Author

a-dubs commented Jan 29, 2025

@toabctl I know I know I marked this as WIP, I just wanted to know if this is something you think is worth adding before proceeding to put time into finalizing this work.

yes! I would really like to see that added. this is also on the TODO list (please drop it from there if you've implemented it).

I was unaware of the to-do list!! Thank you for pointing that out. Will be sure to mark this item as done as part of this PR.

@a-dubs a-dubs force-pushed the add-local-upload-config branch 3 times, most recently from 173232e to e0fb364 Compare March 12, 2025 17:27
@a-dubs a-dubs marked this pull request as ready for review March 12, 2025 17:27
@a-dubs
Copy link
Copy Markdown
Author

a-dubs commented Mar 12, 2025

@rpocase @toabctl this is now ready for review! added docs and functional testing, and merged the config into the ConfigFile model as @toabctl suggested!

@a-dubs a-dubs force-pushed the add-local-upload-config branch from e0fb364 to bb05937 Compare March 12, 2025 17:35
Comment thread chimg/chroot.py Outdated
Comment thread chimg/chroot.py Outdated
Comment thread chimg/chroot.py Outdated
Comment thread chimg/chroot.py Outdated
Comment thread chimg/config.py Outdated
Comment thread chimg/config.py
Comment thread chimg/chroot.py Outdated
rpocase
rpocase previously approved these changes Mar 13, 2025
Copy link
Copy Markdown
Collaborator

@rpocase rpocase left a comment

Choose a reason for hiding this comment

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

lgtm pending tom's suggestion and my nits.

Comment thread chimg/chroot.py Outdated
Comment thread chimg/chroot.py Outdated
Since linting and testing paths are not specified by default in tox.ini,
they would find various untracked files in my working directory and
cause the tests to fail. This change sets the posargs to a more
reasonable default, and adds a lint-fix environment to tox.ini
which will run black and have it auto format the code.
@a-dubs a-dubs force-pushed the add-local-upload-config branch from b6289d6 to 9877222 Compare April 1, 2025 19:44
@a-dubs
Copy link
Copy Markdown
Author

a-dubs commented Apr 1, 2025

@toabctl changes have been made as requested. Ready for re-review.

@rpocase and your nits have been applied as well. the dict is now just parsed back into a ConfigFile object before passed to either of the two chroot file helpers.

@a-dubs a-dubs force-pushed the add-local-upload-config branch from 9877222 to f4009bf Compare April 1, 2025 19:47
This change updates the ConfigFile configuration to allow for specifying
a source path that can be either a directory or file and copying this
to the chroot at the destination path. The 'source' field is mutually
exclusive with the 'content' field for the ConfigFile type.
@a-dubs a-dubs force-pushed the add-local-upload-config branch from f4009bf to 83bd719 Compare April 1, 2025 19:51
@a-dubs a-dubs requested a review from toabctl April 1, 2025 19:56
Comment thread chimg/chroot.py
import yaml

from chimg.common import run_command
from chimg.config import ConfigFile
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

don't import config. This should go through Context. Context should be the only direct user of Config. so use self.ctx.conf

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