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

environments: declarative API inherits from list and collides with list's function names. #305

Open
simbuerg opened this issue Sep 29, 2020 · 3 comments
Assignees

Comments

@simbuerg
Copy link
Member

Example: copy -> buildah copy command.

This collides with the copy method of python's lists. We should rename these. The current implementation in #293 adds a _ as suffix to relevant methods.

Methods:

  • copy -> copy_
  • from (keyword) -> from_

@vulder suggested to use _layer suffix.

This fixes ambiguous naming of methods but looks horrible when used in project's declarative part:

ContainerImage(). \
  from_layer('foo'). \
  add_layer('src', 'dst'). \
  run_layer('cmd', 'arg0', 'arg1')
@vulder
Copy link
Collaborator

vulder commented Oct 1, 2020

I think this looks not to bad. What are your concerns?
run_layer -> run command on this layer?
If this not fully means the thing you can maybe run_on_layer or add_command_layer.
In general the method names should spell what the method does and if run_layer or from_layer don't convey the right meaning, either we are not always working with layers or the original run/from are also not clear.

@simbuerg
Copy link
Member Author

simbuerg commented Oct 1, 2020

The original names mimic the Dockerfile syntax and/or buildah's CLI options. So coming from these tools, you should be familiar with the naming.

Adding *_layer just looks as redundant as adding the 'I' as prefix to Java Interfaces :-).
I guess I will just rename it and avoid a bikeshed.

@simbuerg simbuerg self-assigned this Oct 1, 2020
@vulder
Copy link
Collaborator

vulder commented Oct 1, 2020

hmm, I was hopping to get more bike shedding done today 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants