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

tooling(delete-rem-tags): pass git commit info #19

Merged

Conversation

liketechnik
Copy link
Contributor

@liketechnik liketechnik commented Jul 5, 2022

Passes git author information via environment variables into the docker
container, in order to ensure commits done by the script have correct
author information.

Since the changes in the Makefile occur in the same position as in #16 this PR is based on the changes in #16 and currently targets the branch of #16. GitHub should automatically adjust the target branch if #16 gets merged first (although I just heard it does, I've not tried it yet).

Fixes #18

@liketechnik liketechnik added the bug label Jul 5, 2022
@liketechnik liketechnik requested review from cagix and malt-r July 5, 2022 19:25
@liketechnik liketechnik self-assigned this Jul 5, 2022
@liketechnik liketechnik force-pushed the fix/delete-rem-tags-commit-info branch from 61e8ba6 to f576c36 Compare July 6, 2022 08:59
@liketechnik liketechnik marked this pull request as ready for review July 6, 2022 09:01
@liketechnik liketechnik requested a review from bcg7 July 6, 2022 10:16
@cagix cagix removed request for cagix, malt-r and bcg7 July 6, 2022 11:20
@liketechnik
Copy link
Contributor Author

liketechnik commented Jul 9, 2022

Ich habe den PR jetzt bei mir lokal getestet. Wenn nicht noch weitere Unterschiede zwischen verschiedensten Git und/oder Docker-Konfigurationen für Probleme sorgen, die ich nicht auf dem Schirm habe, funktioniert das in der Form.

Copy link
Member

@cagix cagix left a comment

Choose a reason for hiding this comment

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

lgtm.

@malt-r Funktioniert das damit bei Dir jetzt? Dann würde ich mergen.

@malt-r
Copy link
Contributor

malt-r commented Jul 13, 2022

Bei mir sieht die Ausgabe leider immer noch so aus:

make delete-rem-tags                                                                                                                                                                                                                [mr/ll-parser-test2|●1]
docker run --rm -i -v "/home/malt_r/docs/whk/CB-Lecture-Bachelor:/data" -w "/data"     -u "1000:1000" --entrypoint="/opt/delete-script.rb" --env GIT_DIR=/data/.git --env GIT_AUTHOR_NAME="malte r" --env GIT_AUTHOR_EMAIL="malte.r@mail.de" alpine-pandoc-hugo markdown
Deleting markdown/parsing/ll-parser-theory.md:31 - markdown/parsing/ll-parser-theory.md:42 with commit message 'rm(parsing/ll-parser-theory): specific motivation for CFGs'
Committer identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'unknown@7747c09a9b8e.(none)')
RuntimeError: Command failed with exit 128: git commit -m 'rm(parsing/ll-parser-theory): specific motivation for CFGs'

Passes git author information via environment variables into the docker
container, in order to ensure commits done by the script have correct
author information.
Pass not only author information, but committer information too, since
git seems to be *sometimes* unhappy with only author information, for
whatever reason.
@liketechnik liketechnik force-pushed the fix/delete-rem-tags-commit-info branch from f576c36 to 4479be3 Compare July 16, 2022 20:27
@liketechnik
Copy link
Contributor Author

Hmm. Spannend, bei mir im Container hatte ich das Problem nicht, da war Git dann schon mit ausschließlich mit AUTHOR_ Name und Email glücklich. Warum auch immer das nicht immer klappt, ich habe jetzt einfach mal das selbe für COMMITTER_ gemacht, da er sich darüber in der Fehlermeldung beschwert hat.

@malt-r Kannst du das nochmal bei dir testen? Tut mir leid dass ich damit jetzt zum x-ten Mal komme...

@malt-r
Copy link
Contributor

malt-r commented Jul 18, 2022

Jetzt klappt's! :)

Makefile Outdated Show resolved Hide resolved
@cagix
Copy link
Member

cagix commented Jul 18, 2022

@liketechnik d.h. ich kann jetzt mergen? wie war das, zuerst muss #16, richtig?

@cagix
Copy link
Member

cagix commented Jul 18, 2022

@liketechnik d.h. ich kann jetzt mergen? wie war das, zuerst muss #16, richtig?

neee, scheinbar erst der hier (#19), und danach dann #16. so richtig?

@liketechnik
Copy link
Contributor Author

Die Reihenfolge ist glaube ich eigentlich egal. Aber ja, dieser PR (#19) gehört eigtl zu #16, insofern ergibt erst #19 in #16 und dann #16 nach master mehr Sinn.

Copy link
Member

@cagix cagix left a comment

Choose a reason for hiding this comment

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

lgtm

@cagix cagix merged commit af9aefb into fix/docker-git-unsafe-repository Jul 18, 2022
@cagix cagix deleted the fix/delete-rem-tags-commit-info branch July 18, 2022 13:24
cagix added a commit that referenced this pull request Jul 18, 2022
* tooling: git safe repo directory for docker image

Fixes an issue introduced with a recent git update
(https://github.blog/2022-04-12-git-security-vulnerability-announced/)
with a common workaround (actions/checkout#762,
https://stackoverflow.com/questions/71901632/fatal-error-unsafe-repository-home-repon-is-owned-by-someone-else,
actions/checkout#760),
by marking the /data directory inside the container as safe for git
during the container build.

* tooling: point git to directory instead of disabling security features

Easier to maintain version of 7c2b552
that additionally does not fiddle with security sensitive settings.

* style(Makefile): docker git env into separate variable

* tooling: extract repo location inside container into variable

* tooling: replace missing hardcoded /data with variable

Co-authored-by: Carsten Gips <cagix@fh-bielefeld.de>

* tooling(delete-rem-tags): pass git commit info (#19)

* tooling(delete-rem-tags): pass git commit info

Passes git author information via environment variables into the docker
container, in order to ensure commits done by the script have correct
author information.

* tooling(delete-rem-tags): pass git full commit info

Pass not only author information, but committer information too, since
git seems to be *sometimes* unhappy with only author information, for
whatever reason.

* tooling: makefile formatting

Co-authored-by: Carsten Gips <cagix@fh-bielefeld.de>

* tooling: makefile formatting

Co-authored-by: Carsten Gips <cagix@fh-bielefeld.de>

* tooling: makefile formatting

Co-authored-by: Carsten Gips <cagix@fh-bielefeld.de>

Co-authored-by: Carsten Gips <cagix@fh-bielefeld.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants