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

nixos/redmine mercurial integration is broken #94949

Closed
Stekke opened this issue Aug 8, 2020 · 6 comments · Fixed by #94999
Closed

nixos/redmine mercurial integration is broken #94949

Stekke opened this issue Aug 8, 2020 · 6 comments · Fixed by #94999

Comments

@Stekke
Copy link
Contributor

Stekke commented Aug 8, 2020

Describe the bug
Browsing a hg (mercurial) repository in a redmine project does not work. No repo functionality works when hg is used.

To Reproduce
Steps to reproduce the behavior:

  1. Make use of the redmine module
  2. Add a local hg repo to which redmine has access.
  3. In redmine, go to the project settings page and add the local hg repo
  4. Click the added repo name, or click on the "repository" tab of the project

Now you get to see a 404 page.

Expected behavior
Normally you should be able to browse the repository.

Logs
This issue happens both in the current nixos release and in the unstable, but with different errors:
In release 20.03

Aug 08 18:07:33 nixos bundle[871]: *** failed to import extension redminehelper from /nix/store/c2za42x86iqk8wrxphl4pc2rkb5kbwxq-redmine-4.1.1/share/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py: unicode 'rhannotate' found in cmdtable
Aug 08 18:07:33 nixos bundle[871]: *** (use b'' to make it byte string)
Aug 08 18:07:33 nixos bundle[871]: hg: unknown command 'rhsummary'
Aug 08 18:07:33 nixos bundle[871]: (did you mean summary?)

In unstable

Aug 08 18:30:38 nixos bundle[1133]: *** failed to import extension redminehelper from /nix/store/3sdqxliq5qd15wfzyiclqs5ax1b6ggnc-redmine-4.1.1/share/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py: module 'cgi' has no attribute 'escape'
Aug 08 18:30:38 nixos bundle[1133]: hg: unknown command 'rhsummary'
Aug 08 18:30:38 nixos bundle[1133]: (did you mean summary?)

Additional context
The python hg script that is shipped with redmine (redminehelper.py) seems to be incompatible with the python version is being used when it is called.
Possible related upstream bug: https://www.redmine.org/issues/33784

Notify maintainers
@aanderse

@aanderse
Copy link
Member

aanderse commented Aug 8, 2020

I've never used hg so wouldn't know where to start. Can you provide some config that I can reproduce this with and maybe something will occur to me?

@Stekke
Copy link
Contributor Author

Stekke commented Aug 8, 2020

Not sure what I can give in terms of config.
In order to reproduce you basically do the same as you would with git:

mkdir repo
cd repo/
hg init
touch testfile
hg add testfile
hg commit -m"Added testfile"

And then add it as a repository in the redmine project config, like so:
redmine
EDIT: Not sure if the path should or shoudn't include the .hg at the end, but I didn't get it to work either way.

If you then click on the repo link "hg", or on "repository" tab of the project you get:
404

I then checked what the error log was with: journalctl -u redmine

The following archive has the /var/lib/redmine state directory + also the repo directory as described above + redmine_mysql.db , a database dump of the redmine mysql database (login: admin, password: testtest)
redmine.tar.gz

To be honest I'm not sure if this can be solved in NixOS at all. We might just have to wait until compatibility with python3 is improved upstream.

@prusnak
Copy link
Member

prusnak commented Aug 8, 2020

Sounds like an upstream bug - have you tried reporting it upstream?

@Stekke Stekke changed the title nixos/redmine nixos/redmine mercurial integration is broken Aug 8, 2020
@Stekke
Copy link
Contributor Author

Stekke commented Aug 8, 2020

I think it's already reported: https://www.redmine.org/issues/33784
But I'll add a comment there linking back here...
The patch posted there might solve the issue for us.

@Stekke
Copy link
Contributor Author

Stekke commented Aug 9, 2020

I created a draft PR for this, which I verified fixes this issue.
Though I don't know if we really want to carry around a patch ourselves until upstream fixes things...
The current mercurial <-> redmine situation can't really get any worse, and I don't think this patch can break anything else.
But it might also be worth it to wait for a proper fix from upstream.

@prusnak
Copy link
Member

prusnak commented Aug 9, 2020

I think's fine to carry a patch until upstream fixes things if these two things are met:

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

Successfully merging a pull request may close this issue.

3 participants