-
Notifications
You must be signed in to change notification settings - Fork 874
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
make generate - assumptions about remote names #509
Labels
Comments
jlewi
pushed a commit
to jlewi/manifests
that referenced
this issue
Dec 12, 2019
* use git diff --name-only @{upstream} to compute the diff against the upstream branch. This should be better then the current branch which is making assumptions about the remote repo names. * Furthermore we need to make sure that when the base kustomization package changes that we also regenerate the tests for the overlay packages. * to support that we replace gen-test-targets.sh with a python script. * The bash scripts are pretty impenetrable; migrating to python should make the code easier to maintain. * The name of the go test files generated is slightly different from what the shell scripts were generating. * This is intended to make the naming more consistent * specifically a/b/c/kustimazation.yaml results in tests/a-b-c_test.go * It looks like the shell script was sometimes not including a in the name. * The python script also checks that for _test.go file there is a corresponding kustomization.yaml file; otherwise it will remove the test. This ensures if we move or remove a kustomize package we will end up removing the test. * Fix: kubeflow#509 * Update the pull request template with the command to only generate tests for changed files * Fix kubeflow#171 - gen-test-target.sh should function regardless of checked out name for the repository. We can use git to get the base directory and then do an appropriate string replace. * Need to update the test target generation to not assume the repository is named manifests * Update the github pull_request template to tell users to run `make generate-changed-only`
jlewi
pushed a commit
to jlewi/manifests
that referenced
this issue
Dec 16, 2019
* use git diff --name-only @{upstream} to compute the diff against the upstream branch. This should be better then the current branch which is making assumptions about the remote repo names. * Furthermore we need to make sure that when the base kustomization package changes that we also regenerate the tests for the overlay packages. * to support that we replace gen-test-targets.sh with a python script. * The bash scripts are pretty impenetrable; migrating to python should make the code easier to maintain. * The name of the go test files generated is slightly different from what the shell scripts were generating. * This is intended to make the naming more consistent * specifically a/b/c/kustimazation.yaml results in tests/a-b-c_test.go * It looks like the shell script was sometimes not including a in the name. * The python script also checks that for _test.go file there is a corresponding kustomization.yaml file; otherwise it will remove the test. This ensures if we move or remove a kustomize package we will end up removing the test. * Fix: kubeflow#509 * Update the pull request template with the command to only generate tests for changed files * Fix kubeflow#171 - gen-test-target.sh should function regardless of checked out name for the repository. We can use git to get the base directory and then do an appropriate string replace. * Need to update the test target generation to not assume the repository is named manifests * Update the github pull_request template to tell users to run `make generate-changed-only`
k8s-ci-robot
pushed a commit
that referenced
this issue
Dec 16, 2019
* Fix computation of changed files in generate-changed-only rule * use git diff --name-only @{upstream} to compute the diff against the upstream branch. This should be better then the current branch which is making assumptions about the remote repo names. * Furthermore we need to make sure that when the base kustomization package changes that we also regenerate the tests for the overlay packages. * to support that we replace gen-test-targets.sh with a python script. * The bash scripts are pretty impenetrable; migrating to python should make the code easier to maintain. * The name of the go test files generated is slightly different from what the shell scripts were generating. * This is intended to make the naming more consistent * specifically a/b/c/kustimazation.yaml results in tests/a-b-c_test.go * It looks like the shell script was sometimes not including a in the name. * The python script also checks that for _test.go file there is a corresponding kustomization.yaml file; otherwise it will remove the test. This ensures if we move or remove a kustomize package we will end up removing the test. * Fix: #509 * Update the pull request template with the command to only generate tests for changed files * Fix #171 - gen-test-target.sh should function regardless of checked out name for the repository. We can use git to get the base directory and then do an appropriate string replace. * Need to update the test target generation to not assume the repository is named manifests * Update the github pull_request template to tell users to run `make generate-changed-only` * Address comments. * Latest.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#466 modified the script to generate the updated tests to only generate tests for what's changed.
I get the following error
It looks like the script is making assumptions about the remote name that is used for the fork and the upstream.
A more robust approach is to find the remote based on the remote URL rather than assuming its named upstream.
I thought we had a shell script that was doing that but I can't remember which one.
I'm not sure what the script is computing the diff using the name of the remote fork e.g. "origin/fix_head" rather than just assuming its the local branch.
The text was updated successfully, but these errors were encountered: