Feature #27831

ATOM Feed for repository changes

Added by Felix Schäfer 10 months ago. Updated 9 months ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Feeds
Target version:-
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.

27831.patch Magnifier (3.95 KB) Felix Schäfer, 2017-12-21 11:19

27831-error-log.txt Magnifier - Error log (ActionView::Template::Error) (5.03 KB) Go MAEDA, 2018-01-05 04:25

27831-master.patch Magnifier (3.55 KB) Felix Schäfer, 2018-01-09 00:00

History

#1 Updated by Felix Schäfer 10 months ago

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

#2 Updated by Go MAEDA 10 months ago

  • Category set to Feeds

#3 Updated by Go MAEDA 10 months 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

#4 Updated by Felix Schäfer 9 months 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.

#5 Updated by Go MAEDA 9 months 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)

Also available in: Atom PDF