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

Integrations.test is erroneously used as the hook in pre-receive.d of a forked repo in integration testing #1910

Closed
2 of 7 tasks
typeless opened this issue Jun 8, 2017 · 1 comment · Fixed by #1923
Closed
2 of 7 tasks

Comments

@typeless
Copy link
Contributor

typeless commented Jun 8, 2017

  • Gitea version (or commit ref):
    v1.1.0-289-g9ddc35e

  • Git version:
    2.7.4

  • Operating system:
    Ubuntu 16.04 64bit

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Under the environment created by integrations.test, a forked repo will contain a hook which looks like the following:

cat /tmp/repo1.git/hooks/pre-receive.d/gitea
#!/usr/bin/env bash
"/home/mura/devel/go/src/code.gitea.io/gitea/integrations.test" hook --config='/home/mura/devel/go/src/code.gitea.io/gitea/integrations/sqlite.ini' pre-receive

For some clues I've found so far:
https://github.com/go-gitea/gitea/blob/master/models/repo.go#L946
https://github.com/go-gitea/gitea/blob/master/modules/setting/setting.go#L510
...

P.S. The problem can be reproduced with #1912

Screenshots

If this issue involves the Web Interface, please include a screenshot

@lunny lunny added this to the 1.x.x milestone Jun 8, 2017
@typeless
Copy link
Contributor Author

typeless commented Jun 9, 2017

Any thoughts?

The problem seems to be due to the limitation of the integration framework or the way that the hooks are handled. Neither are obvious to fix to me.

@lunny lunny modified the milestones: 1.2.0, 1.x.x Jul 9, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
earl-warren pushed a commit to earl-warren/gitea that referenced this issue Dec 10, 2023
- Currently there's code to recover gracefully from panics that happen
within the execution of cron tasks. However this recover code wasn't
being run, because `RunWithShutdownContext` also contains code to
recover from any panic and then gracefully shutdown Forgejo. Because
`RunWithShutdownContext` registers that code as last, that would get run
first which in this case is not behavior that we want.
- Move the recover code to inside the function, so that is run first
before `RunWithShutdownContext`'s recover code (which is now a noop).
- Resolves go-gitea#1910
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants