Skip to content

Conversation

@matentzn
Copy link
Contributor

@matentzn matentzn commented Nov 28, 2024

At my wits end, I now consulted with various AI tools and they say:

persist-credentials: false:

Ensures the credentials are correctly stored for subsequent Git operations, preventing authentication issues.

This is super annoying.. Now your suggestion (of testing locally) wont even work because the problem is specifically about the last github action step, so you cant really test it anywhere other than in the repo (or in a fork, which is a lot of churn).

I wonder, alternatively, if it would work to run it all in Ubuntu base image, and then

run: |
          docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:24.04 \
          sh update-constraints.sh --in-docker

just in the Build constraints.txt step?

At my wits end, I now consulted with various AI tools and they say:

```
persist-credentials: false:

Ensures the credentials are correctly stored for subsequent Git operations, preventing authentication issues.
```

This is super annoying.. Now your suggestion wont even work because the problem is _specifically_ about the last github action step, so you cant really test it anywhere other than in the repo (or in a fork, which is a lot of churn).

I wonder, alternatively, if it would work to run it all in Ubuntu base image, and then

```
run: |
          docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:24.04 \
          sh update-constraints.sh --in-docker
```

just in the Build constraints.txt step?
@matentzn matentzn requested a review from gouttegd November 28, 2024 08:33
@gouttegd
Copy link
Contributor

I now consulted with various AI tools and they

did the typical AI crap of not having the slightest understanding of the entire issue, seeing a few keywords and jumping at a conclusion. “PhD-level intelligence“ my arse!

Looking at the last failed workflow, at the “create pull request” step:

Save persisted git credentials
  /usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader ^AUTHORIZATION:
  fatal: --local can only be used inside a git repository
Determining the base and head repositories
  /usr/bin/git config --local --get remote.origin.url
  fatal: --local can only be used inside a git repository
  Error: The format of '' is not a valid GitHub repository URL
Restore persisted git credentials
  /usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader ^AUTHORIZATION:
  fatal: --local can only be used inside a git repository

Look how all Git commands fail with a fatal: --local can only be used inside a Git repository -- including the second command (“determining the base and head repositories“), which has nothing to do with the “saving/restoring of persisted git credentials“. Disabling the persistence of Git credentials would remove the first and third commands, but those commands are clearly not the root cause of the problem -- despite what an over-hyped, power-hungry, time-wasting stochastic parrot may say.

Compare with a previous non-failed workflow:

Save persisted git credentials
  /usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader ^AUTHORIZATION:
  http.https://github.com/.extraheader
  /usr/bin/git config --local --get-regexp http.https://github.com/.extraheader ^AUTHORIZATION:
  http.https://github.com/.extraheader AUTHORIZATION: basic ***
  /usr/bin/git config --local --unset http.https://github.com/.extraheader ^AUTHORIZATION:
  Unset config key 'http.https://github.com/.extraheader'
Determining the base and head repositories
  /usr/bin/git config --local --get remote.origin.url
  https://github.com/INCATools/ontology-development-kit
Pull request branch target repository set to INCATools/ontology-development-kit
Configuring credential for HTTPS authentication
  /usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***

See how the “determining the base and head repositories“ step did not fail here?

So, the real problem here, which has nothing to do with credentials that are persisted or not, in that in our new workflow, for some reason git does not seem to think it is running within a repository. Now why does that happen, I have no clue, but playing with credentials persistence is not going to change anything.

run: |
         docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:24.04 \
         sh update-constraints.sh --in-docker

This looks like a much better solution. One that actually makes perfect sense, contrary to that AI crap.

I am wondering though if `docker` is really available in `ubuntu-latest`, so I added a little check to fail early when it is the case.

I removed `Install Required Packages` again as these are available in the ubuntu base image.
@matentzn
Copy link
Contributor Author

Next shot in the oven..

Copy link
Contributor

@gouttegd gouttegd left a comment

Choose a reason for hiding this comment

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

I am no longer sure of anything with this workflow 😅 , but this does look good to me.

@matentzn matentzn merged commit 4790f5f into master Nov 29, 2024
1 check passed
@matentzn matentzn deleted the 2124-11-28 branch November 29, 2024 16:27
@matentzn
Copy link
Contributor Author

It worked!!!! 🎉

@gouttegd
Copy link
Contributor

Can’t help but noticing that in the end, it was the idea tentatively advanced by a human with a modest “I wonder if…” that was correct over the pseudo-solution confidently advanced by a LLM. Isn’t that interesting?

@matentzn
Copy link
Contributor Author

Hhaha..

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants