Fix credentials not passed or configured the CI workflow#286
Merged
llucax merged 8 commits intofrequenz-floss:v0.x.xfrom Jul 3, 2024
Merged
Fix credentials not passed or configured the CI workflow#286llucax merged 8 commits intofrequenz-floss:v0.x.xfrom
llucax merged 8 commits intofrequenz-floss:v0.x.xfrom
Conversation
The new actions is also able to set credentials, and we add an example on how to set credentials for projects that have private dependencies. We also move the step to the beginning, in case the submodule dependencies are private. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
If we do a Git checkout, there is the chance that we also need to fetch some private submodule we need credentials for. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com> # ------------------------ >8 ------------------------ # Do not modify or remove the line above. # Everything below it will be ignored. # # Conflicts: # tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/ci.yaml
Contributor
Author
|
FYI @cwasicki |
4f4b42d to
2a37fa2
Compare
Marenz
reviewed
Jul 2, 2024
| steps: | ||
| - name: Setup Git | ||
| uses: frequenz-floss/gh-action-setup-git@v0.x.x | ||
| # TODO(cookiecutter): Uncomment this for projects with private dependencies |
Contributor
There was a problem hiding this comment.
Any disadvantage if we just always set this?
Contributor
Author
There was a problem hiding this comment.
I just am very paranoid about passing around credentials where they are not really needed. 🤷
Contributor
Author
|
Oh, damn, this doesn't work if credentials are not passed because |
Credentials were not being passed to the docker build process, and the installation test runs as part of the image builting, so it fails when some `pip` dependency needs git credentials to be fetched. This commit fixes this by passing the `.git-credentials` file generated by the `frequenz-floss/gh-action-setup-git` action to the docker build process. Even when the produced docker image doesn't leave the GitHub runner, this is not ideal because we are storing credentials in the docker image, so eventually this job should be changed so the tests is done in a running container instead of a docker image building process, but for now is a good-enough workaround. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
We'll remove the TODOs in the next commit. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Contributor
Author
|
ping @Marenz |
Marenz
approved these changes
Jul 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setup-git-userstep withgh-action-setup-gitgh-action-setup-gitstep to every job doing a checkouttest-installationjobFixes #278.