RhodeCode - issues: Issueshttps://issues.rhodecode.com/https://issues.rhodecode.com/favicon.ico?16960560042019-01-30T17:43:29ZRhodeCode - issues
Redmine RhodeCode CE/EE - Support #5527 (New): API: expose human readable failure reasonhttps://issues.rhodecode.com/issues/55272019-01-30T17:43:29ZDaniel Ddaniel@rhodecode.com
<p>Currently API returns something like this:</p>
<pre><code>{
"result": {
"merge_ref": {
"name": "pr-merge",
"type": "book",
"commit_id": "xxxxx"
},
"merge_commit_id": "xxxxx", //(same value as the commit_id)
"executed": false,
"possible": true,
"failure_reason": 3
},
"id": "mergepr",
"error": null
}
</code></pre>
<p>"failure_reason": 3 is cryptic, we have a translation layer for that already, so we just need tp expose failure_reason_explanation and read it !</p>
RhodeCode CE/EE - Task #4289 (New): [ce, ee] clean up pygments lexer functions + handlinghttps://issues.rhodecode.com/issues/42892016-10-21T14:40:28ZDaniel Ddaniel@rhodecode.com
<p>Currently there are a few lexer functions that seem duplicated/incoherent with each other. This seems to be also tied with the rc extensions which can define custom lexers/file extension mappings in example-ext.py:</p>
<pre><code>
# =============================================================================
# END OF UTILITY FUNCTIONS HERE
# =============================================================================
# Additional mappings that are not present in the pygments lexers
# used for building stats
# format is {'ext':['Names']} eg. {'py':['Python']} note: there can be
# more than one name for extension
# NOTE: that this will override any mappings in LANGUAGES_EXTENSIONS_MAP
# build by pygments
EXTRA_MAPPINGS = {}
# additional lexer definitions for custom files it's overrides pygments lexers,
# and uses defined name of lexer to colorize the files. Format is {'ext':
# 'lexer_name'} List of lexers can be printed running:
# >> python -c "import pprint;from pygments import lexers;
# pprint.pprint([(x[0], x[1]) for x in lexers.get_all_lexers()]);"
EXTRA_LEXERS = {}
</code></pre>
<p>Then there are the functions get_custom_lexer and the FileNode attributes <code>filenode.lexer</code> which don't seem to follow the same logic - the filenode lexer for example seems to prefer a lexer matching the filename instead of a defined custom lexer.</p>
<p>We should use a common base for getting a lexer - one that first returns custom lexer mappings (so that for example .html can be mapped to mako).</p>
<p>Extending on this it could be possible to make the file extension => lexer mapping a per repository setting, exposed via the ui, which would give the best usability in terms of letting each repo specify which lexer to prefer ... again for example <code>.html => mako</code> </p>
RhodeCode CE/EE - Bug #4256 (New): [ce, ee, ux] Source code highlight colors conflict with red/gr...https://issues.rhodecode.com/issues/42562016-10-03T05:00:14ZDaniel Ddaniel@rhodecode.com
<p>The CSS for pygments uses some green and red text which conflict with green/red blocks we use in diffs - have to change these to something else. </p>
RhodeCode CE/EE - Task #4246 (New): [ce, ee, vcs, git] add tests for annotated git tagshttps://issues.rhodecode.com/issues/42462016-09-27T15:46:51ZDaniel Ddaniel@rhodecode.com
<p>Need to add a test that makes sure annotated git tags are correctly dereferenced / peeled to the actual commit they point to.</p>
RhodeCode CE/EE - Feature #4232 (New): [ce, ee, pr, compare] redo diffs, support side by side dif...https://issues.rhodecode.com/issues/42322016-09-18T16:40:43ZDaniel Ddaniel@rhodecode.com
<p>One of the most requested features is side by side diffs for multiple files at the same time (eg. pull request & compare pages).</p>
<p>Currently we have side by side diffs implemented for a single files only using the javascript library mergely. This doesn't include inline comments and uses different syntax highlighting to the rest of Rhodecode. Copy paste of code also works differently between the pr page and the side/side view.</p>
<p>There is another javascript diff library: <a href="https://diff2html.xyz/demo" class="external">https://diff2html.xyz/demo</a>, which gives very good results, however integrating inline comments and context loading into this proved to be a lot of trouble, also the syntax highlighting doesn't support partial code blocks very well, eg:</p>
<pre><code>51 this is the end of a doc string
52 """
53 return True
</code></pre>
<p>will mark the <code>return True</code> part as a string.</p>
<p>Therefore the things we need in diffs are:</p>
<ul>
<li>Syntax highlighting based on the entire file, rather than the partial diff</li>
<li>Inline comments + all relevant functionality</li>
<li>Ajax file context loading (eg. click to load more lines of a file before/after the changed lines)</li>
<li>In the browser conversion between raw/unified/side diffs - using JS</li>
</ul>
<p>This will be exposed as a reusuable widget that can be used anywhere in Rhodecode, taking a diff reference as a sole argument.</p>
<p>The steps to create the diff are:</p>
<ol>
<li>Generate the diff chunks for each file</li>
<li>Get the old and new versions of the files, highlight using pygments</li>
<li>Use custom pygments renderer to generate the diff context:
<ol>
<li>Using the original highlighted file lines which will have proper syntax highlighting colors</li>
<li>Support both unified/sideside without modification</li>
<li>Use a table that is copypaste friendly</li>
<li>Add inline comments + functionality </li>
<li>Expose load more file lines context functionality markers</li>
</ol></li>
<li>Render this in the template</li>
<li>Apply javascript events lazily to avoid the overheads of adding events to every single element</li>
</ol>
<p>This will also require an endpoint to get the partial N-M lines context of a file @ revision via ajax</p>
RhodeCode CE/EE - Bug #4208 (New): [ce, ee] test errors get hidden by error pagehttps://issues.rhodecode.com/issues/42082016-08-30T18:42:32ZDaniel Ddaniel@rhodecode.com
<p>When running tests the traceback is excepted away by the error handler page, this makes it difficult to debug since eg</p>
<pre><code>app.get('/page_that_errors')
</code></pre>
<p>will return a 500 error page instead of a traceback.</p>
<p>OTOH making tests always raise errors will then break the page that checks if the pretty error page is working as it should.</p>
<p>Need to add a dynamic setting, eg settings['use_error_document'] = False - that can be turned on/off at will and will disable the pretty error page handler for running tests.</p>
RhodeCode CE/EE - Task #4197 (New): [ce, ee] get list of users with their permissions to a reposi...https://issues.rhodecode.com/issues/41972016-08-24T14:31:24ZDaniel Ddaniel@rhodecode.com
<p>Related to <a href="https://issues.rhodecode.com/issues/4150" class="external">https://issues.rhodecode.com/issues/4150</a></p>
<p>Need a way to get all users from a repository along with their permissions for that repo.</p>
<p>At the moment permissions are generated via a complex python object in rhodecode.lib.auth:AuthUser which calculates the tree for a single user, taking into account default user, repo settings (overriding globals or not), and usergroups.</p>
<p>Iterating over the entire list of users is much too slow, some preliminary benchmarks show that it will take 10seconds / 100users.</p>
<p>In order to do this quickly instead, we would have to generate permissions via sql - A simplish (not completely correct results) query shows it will take about 50ms on internal rhodecode db.</p>
<pre><code>
SELECT
users.username,
repositories.repo_name,
MIN(origin_sort || '-' || permission_name) as perm
FROM (
SELECT
'' as ug,
permissions.permission_name,
user_id,
repository_id,
'1-user' as origin_sort
FROM
repo_to_perm
JOIN
permissions ON
permissions.permission_id = repo_to_perm.permission_id
-- WHERE repository_id = 190
UNION ALL
SELECT
users_groups.users_group_name,
permissions.permission_name,
users_groups_members.user_id,
repository_id,
'2-usergroup-' || users_groups.users_group_name as origin_sort
FROM
users_group_repo_to_perm
JOIN
permissions ON
permissions.permission_id = users_group_repo_to_perm.permission_id
JOIN
users_groups_members
ON
users_groups_members.users_group_id = users_group_repo_to_perm.users_group_id
JOIN
users_groups
ON
users_group_repo_to_perm.users_group_id = users_groups.users_group_id
-- WHERE repository_id = 190
) tmp_user_and_usergroup_perms
JOIN users ON users.user_id = tmp_user_and_usergroup_perms.user_id
JOIN repositories ON repositories.repo_id = tmp_user_and_usergroup_perms.repository_id
GROUP BY users.username, repositories.repo_name
ORDER BY username, perm
;
</code></pre> RhodeCode CE/EE - Task #4179 (New): [ce, ee] refine perms summary listhttps://issues.rhodecode.com/issues/41792016-08-17T02:16:51ZDaniel Ddaniel@rhodecode.com
<p>Sort by name, otherwise it's hard to find repos when list is large.</p>
RhodeCode CE/EE - Bug #4154 (New): [ce, ee] user register via github captchahttps://issues.rhodecode.com/issues/41542016-08-05T22:51:47ZDaniel Ddaniel@rhodecode.com
<p>Found on code.rhodecode.com - sign up using github account - captcha is asked but not verified.</p>
RhodeCode CE/EE - Task #4147 (New): [ce, ee, docs] Events documentationhttps://issues.rhodecode.com/issues/41472016-08-04T03:52:39ZDaniel Ddaniel@rhodecode.com
<p>We need to add documentation of the json structure that events emit. Would be a good idea to make this auto generated from dummy events so that there is no sync issue between docs/reality.</p>
RhodeCode CE/EE - Bug #4040 (New): [ce, ee] logout when logged out causes 403 Cross-site request ...https://issues.rhodecode.com/issues/40402016-06-22T21:09:03ZDaniel Ddaniel@rhodecode.com
<p>Reproduce:</p>
<ul>
<li>Login to rhodecode</li>
<li>Logout in another tab</li>
<li>Click logout in original tab</li>
</ul>
RhodeCode CE/EE - Bug #3963 (New): [ce] Getting a newly added repo via remap/rescan via api gives...https://issues.rhodecode.com/issues/39632016-05-27T05:02:18ZDaniel Ddaniel@rhodecode.com
<p>Steps to reproduce:</p>
<ul>
<li>Add a repository to the repo directory</li>
<li>Do a Remap/Rescan</li>
<li>Try get repo_data via api</li>
<li>The last changeset is reported as 00000000000000000</li>
</ul>
<p>Workaround</p>
<ul>
<li>Open the repo change log in Rhodecode loads the data</li>
</ul>
<p>Possible fix:</p>
<ul>
<li>Clear cache and do an update on repo when it is remapped</li>
</ul>
RhodeCode CE/EE - Bug #3956 (New): [ce] - svn commit with all 'None' properties (author, message,...https://issues.rhodecode.com/issues/39562016-05-23T17:22:52ZDaniel Ddaniel@rhodecode.com
<p>It's commit 287 in the libpri repo <code>svn checkout http://svn.asterisk.org/svn/libpri/branches/1.4 libpri</code></p>
<p>Should investigate why/how this happens.</p>
RhodeCode CE/EE - Bug #3922 (New): svn backend returns different diff to git/hg backendshttps://issues.rhodecode.com/issues/39222016-05-11T14:29:02ZDaniel Ddaniel@rhodecode.com
<p>In vcsserver calling <code>a_vcs_backend.diff(rev1='same', rev2='same', path1='samefile', path2='samefile').raw_data</code></p>
<p>returns for SVN:</p>
<pre><code>Index: samefile
===================================================================
diff --git a/samefile b/samefile
--- a/samefile\t(revision 2)
+++ b/samefile\t(revision 2)
</code></pre>
<p>and empty string for both git / hg</p>
<p>Not sure what the correct thing to do is here, empty string makes sense but maybe not when a path has been given in?</p>
RhodeCode CE/EE - Bug #3615 (New): (OperationalError) too many SQL variables on admin journal pagehttps://issues.rhodecode.com/issues/36152016-05-06T11:44:17ZDaniel Ddaniel@rhodecode.com
<p>Steps to reproduce:</p>
<ul>
<li>use sqlite database</li>
<li>add over 1000 repos</li>
<li>open /_admin/journal</li>
</ul>
<p>OperationalError: (OperationalError) too many SQL variables u'SELECT count(*) AS count_1 \nFROM (SELECT user_logs.user_log_id AS user_logs_user_log_id, user_logs.user_id AS user_logs_user_id, user_logs.username AS user_logs_username, user_logs.repository_id AS user_logs_repository_id, user_logs.repository_name AS user_logs_repository_name, user_logs.user_ip AS user_logs_user_ip, user_logs.action AS user_logs_action, user_logs.action_date AS user_logs_action_date \nFROM user_logs \nWHERE user_logs.repository_id IN (?, ?, ?, ?, ?, ?, ?......) ORDER BY user_logs.action_date DESC) AS anon_1' (1,2,....1001 ids)</p>
<pre><code>File "/Users/dan/Projects/rc/rhodecode-enterprise-ce-dan/rhodecode/controllers/journal.py", line 262, in public_journal
c.journal_pager = Page(journal, page=p, items_per_page=20)
File "/nix/store/08jg8cv3mdsjdqa367b9gmilcmif46s3-python2.7-WebHelpers-1.3/lib/python2.7/site-packages/webhelpers/paginate.py", line 413, in __init__
self.item_count = len(self.collection)
</code></pre>
<p>The problem is in <code>rhodecode.controllers.journal.JournalController:_get_journal_data()</code></p>
<p>The query it generates has an IN which can fill up to the max limit for sqlite</p>
<p>Possible solutions:</p>
<ul>
<li>use a for loop</li>
<li>rewrite query to use joins instead</li>
</ul>
<p>Current workarounds:</p>
<ul>
<li>use mysql/postgresql</li>
</ul>