chore: allow new-client.py to run directly without workspace#8653
Conversation
|
Was there any problem with using workspace? I found using workspace (additional repository clone) is useful. Developing the script is simpler if we have 1 repository clone for new-client.py development and 1 repository clone for generated new client. If you came up with a good way to develop new-client.py within 1 repository copy while testing library generation, I want to know the method (It's worth writing down in generation/new_client/README.md). |
The problem with the workspace is that you can't make changes to the new-client.py script and test them without pushing upstream. It also makes it not hermetic. Additionally, there's overhead with checking out the whole repository first, when you already have it. Can you explain how development is easier with two different git repositories in one workspace?
This PR allows you to develop new-client.py within the same repository copy. That's exactly what I did while preparing this PR and generating #8646. I just excluded new-client.py from committing with the new module and created a separate PR. |
In HOME/google-cloud-java you create a development branch for new-client.py (e.g., new-client-changes). You run new-client.py script and it creates HOME/google-cloud-java/generation/workspace/monorepo (e.g., new_module_java-discoveryengine). These two branches are separated; you don't have to push new-client-changes to main (upstream).
Having separate repository clones make the branches maintenance easier. 2 repository copy, 2 branches, and 2 pull requests.
Good. That works Can you add that instruction to README? |
| f" $ cd {monorepo_root}\n" | ||
| print(f"Please create a pull request:\n" | ||
| f" $ git checkout -b new_module_java-{output_name}\n" | ||
| f" $ git add .\n" |
There was a problem hiding this comment.
This would include any change to new-client.py. Can you add an instruction to avoid that? With that instruction, next person who touches new-client.py will avoid committing changes to the new library creation request.
There was a problem hiding this comment.
Why would someone need to modify new-client.py as part of a routine new library generation? However, even if they do, what's wrong with including it with the new library PR? It could help see the impact of the changes. We've been doing this kind of thing with every other script in generation directory, often including changes to scripts and their execution in the same PR.
The reason you have to push all the way to main is this line: It makes the starting point the Where |
24ee2ac to
1b861aa
Compare
No description provided.