プロジェクト

全般

プロフィール

Vote #79025

未完了

ATOM Feed for repository changes

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Feeds_18
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
18
version_id:
32
issue_org_id:
27831
author_id:
3866
assigned_to_id:
0
comments:
7
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

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.


journals

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

--------------------------------------------------------------------------------
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?

<pre>
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'
</pre>

Error log: attachment:27831-error-log.txt
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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".

<pre>
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)
</pre>
--------------------------------------------------------------------------------
I fixed Felix's patch attachment: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.

<pre>
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)
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが約2年前に更新

  • カテゴリFeeds_18 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0