Project

General

Profile

Actions

Feature #27831

open

ATOM Feed for repository changes

Added by Felix Schäfer almost 7 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Feeds
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Repositories currently offer 2 views over revisions, the "all revisions" view (RepositoriesController#revisions), which will show all commits/revisions to that repository, and the "revisions/changes" view (RepositoriesController#changes), which will show all commits/revisions preceding a named revision or a branch.

There currently is an ATOM feed for the "all revisions" view, unfortunately there is no feed for the "revisions/changes" view. Having a feed of the revisions of only a particular branch is useful for external integrations.


Files

27831.patch (3.95 KB) 27831.patch Felix Schäfer, 2017-12-21 11:19
27831-error-log.txt (5.03 KB) 27831-error-log.txt Error log (ActionView::Template::Error) Go MAEDA, 2018-01-05 04:25
27831-master.patch (3.55 KB) 27831-master.patch Felix Schäfer, 2018-01-09 00:00
27831-fixed.patch (3.5 KB) 27831-fixed.patch Yuichi HARADA, 2020-01-07 02:35
Actions #1

Updated by Felix Schäfer almost 7 years ago

The attached patch adds an ATOM feed for the "revisions/changes" view.

Actions #2

Updated by Go MAEDA almost 7 years ago

  • Category set to Feeds
Actions #3

Updated by Go MAEDA almost 7 years ago

With the patch applied to the latest trunk r17140, I encountered the following error when I opened RepositoriesController#changes page. Could you take a look at it?

ActionView::Template::Error (unable to convert unpermitted parameters to hash):
    22: <% end %>
    23:
    24: <% other_formats_links do |f| %>
    25:   <%= f.link_to 'Atom', :url => params.merge({:key => User.current.rss_key}) %>
    26: <% end %>
    27:
    28: <% html_title(l(:label_change_plural)) -%>

lib/redmine/views/other_formats_builder.rb:26:in `merge'
lib/redmine/views/other_formats_builder.rb:26:in `link_to'
app/views/repositories/changes.html.erb:25:in `block in _app_views_repositories_changes_html_erb___3745583827616173410_70126154703040'
app/helpers/application_helper.rb:526:in `other_formats_links'
app/views/repositories/changes.html.erb:24:in `_app_views_repositories_changes_html_erb___3745583827616173410_70126154703040'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Error log: 27831-error-log.txt

Actions #4

Updated by Felix Schäfer almost 7 years ago

Go MAEDA wrote:

With the patch applied to the latest trunk r17140, I encountered the following error when I opened RepositoriesController#changes page. Could you take a look at it?

I can confirm the error, it seems there have been more changes regarding ATOM feeds in master than I thought. The previous patch I provided should work with current stable, not current trunk/master.

I have adapted the patch for master, please find the patch attached.

Actions #5

Updated by Go MAEDA almost 7 years ago

Felix, thank you for updating the patch. But I have not got atom feed yet.

I tested the patch with Redmine's bundled test fixtures and repositories. I get "404 The entry or revision was not found in the repository" error when I click "Atom" link on the changes page (e.g. /projects/ecookbook/repository/changes/subversion_test/helloworld.c).

I noticed two things while seeing the log. First, there is a line "Processing by .... as HTML". I think "HTML" should be "ATOM" because I tried to get an Atom feed. Second, the "path" parameter has a strange extension ".c.atom". Probably it should be ".c".

Started GET "/projects/ecookbook/repository/changes/subversion_test/helloworld.c
.atom?key=253fb4856f8f7518efd462d9c41a8791be24698b" for 127.0.0.1 at 2018-01-11
05:54:29 +0000
Processing by RepositoriesController#changes as HTML
  Parameters: {"key"=>"253fb4856f8f7518efd462d9c41a8791be24698b", "id"=>"ecookbo
ok", "path"=>"subversion_test/helloworld.c.atom"}
  .
(snip)
  .
Completed 404 Not Found in 137ms (Views: 81.1ms | ActiveRecord: 9.9ms)
Actions #6

Updated by Yuichi HARADA almost 5 years ago

I fixed Felix's patch 27831-master.patch (mainly config/routes.rb). I attached a fixed patch.

Go MAEDA wrote:

I tested the patch with Redmine's bundled test fixtures and repositories. I get "404 The entry or revision was not found in the repository" error when I click "Atom" link on the changes page (e.g. /projects/ecookbook/repository/changes/subversion_test/helloworld.c).

I did a similar test. The ATOM feed has been output.

Started GET "/projects/ecookbook/repository/10/changes/subversion_test/helloworld.c.atom?key=0bff9fd16476ad80fac510da47667ac16c2acb43" for 127.0.0.1 at 2020-01-07 09:37:29 +0900
Processing by RepositoriesController#changes as ATOM
  Parameters: {"key"=>"0bff9fd16476ad80fac510da47667ac16c2acb43", "id"=>"ecookbook", "repository_id"=>"10", "path"=>"subversion_test/helloworld.c"}
 ..
  Rendering common/feed.atom.builder
(snip)
  Rendered common/feed.atom.builder (19.8ms)
 ..
Completed 200 OK in 85ms (Views: 21.2ms | ActiveRecord: 4.9ms)
Actions #7

Updated by Go MAEDA almost 5 years ago

  • Status changed from Needs feedback to New
  • Target version set to Candidate for next major release
Actions

Also available in: Atom PDF