Skip to content
Snippets Groups Projects

Adding rss feeds for tags

6 unresolved threads

What does this MR do?

Adding atom on tags project.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Usefull when tracking multiple projects for release using the atom feed.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #2635 (moved)

Edited by username-removed-378947

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @khim.tieu.philippe thanks a lot for the contribution! 💚 I left some feedback / questions for you.

  • I also created https://gitlab.com/gitlab-org/gitlab-ce/issues/33584 to tackle the duplication that we have in the templates (but that's a separate issue, if you want to address it as well, please open a separate merge request 😄 ).

  • @adamniedzielski I just push it 😄

  • @khim.tieu.philippe since you already implemented https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12114, can you rebase this merge request and use the newly introduced layout?

  • @adamniedzielski No problem about the layout

  • added 316 commits

    • 57388c83...5f42009f - 294 commits from branch gitlab-org:master
    • 5f3a83df - Adding atom format support on tags controller
    • f74c927f - Adding atom template for tags#index
    • 73afe2ec - [ui] adding rss icon on project/tags page
    • 168be3bf - Adding atom link on HEAD and update class for atom link
    • 62a9c813 - Adding a test to check if the link is rendered
    • 3fd99f22 - Adding feature rss tests on tags
    • 43226074 - Move rss button next to New Tag button
    • 3d981498 - cleantup comment lines
    • 42bc3044 - Adding contrib file
    • cf1ada1d - Replace double quote by single quote
    • 019a875c - Replace double quote by single quote when possible, update first link by self in…
    • d096846a - Replace double quote by single quite, and remove an empty line
    • 756f856e - On tests, replace project.team << for project.add_developper
    • ca622b50 - adding tests on tags atom feed
    • 6de8568a - Fix on atom tags, we need to get the commit before to do anything
    • dd7d27ba - Start adding test on Atom feed, but with xpath we do have a strange thing...
    • a4587ac4 - Update tests on controllers and features
    • d6bc3c08 - Use xml.atom layout to render rss feed on project/tags
    • f547ac19 - On tags controller spec, do not tests the output
    • 0991eb09 - Adding a shared test for rss to check if the page is an atom feed
    • bbc5c0f1 - Update tests on project/tags by testing and checking atom feed
    • ca3ce5b9 - replace double quote by simple quote

    Compare with previous version

  • @adamniedzielski So as you suggest I've updated the tests to click on the feed, and adding some tests on the atom feeds. Feel free to give me some feedback.

  • 17 17
    18 18 expect(rendered).to have_button('Last updated')
    19 19 end
    20
    21 it 'has tags feed link as Tags feed' do
  • 31 xml = Nokogiri::XML(page.body) { |config| config.noblanks }
    32
    33 expect(page.response_headers['Content-Type']).to have_content 'application/atom+xml'
    34
    35 # Check root feed with namespace
    36 expect(xml.xpath('/atom:feed', 'atom' => 'http://www.w3.org/2005/Atom')).not_to be_empty
    37
    38 # remove all namespace for more simplicity
    39 xml.document.remove_namespaces!
    40 expect(xml.xpath('/feed/id')).not_to be_empty
    41 expect(xml.xpath('/feed/title')).not_to be_empty
    42 expect(xml.xpath('/feed/link')).not_to be_empty
    43 expect(xml.xpath('/feed/updated')).not_to be_empty
    44 expect(xml.xpath('/feed/entry')).not_to be_empty
    45 end
    46 end
  • 21 21 expect(page).to have_css("a:has(.fa-rss):not([href*='rss_token'])")
    22 22 end
    23 23 end
    24
    25 shared_examples "the page is an atom feed" do
  • 10 login_as(user)
    11 visit namespace_project_tags_path(project.namespace, project, :master)
    12 end
    13
    14 describe 'visit project tags page' do
    15 it_behaves_like "it has an RSS button with current_user's RSS token"
    16 it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
    17
    18 describe 'click atom link' do
    19 before do
    20 click_link 'Tags feed'
    21 releases = project.releases
    22 pp releases
    23 end
    24
    25 it_behaves_like "the page is an atom feed"
  • 1 require 'spec_helper'
    2
    3 feature 'Project Tags RSS', :feature do
    4 let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
  • 1 require 'spec_helper'
    2
    3 feature 'Project Tags RSS', :feature do
  • @adamniedzielski I've also add a rss tests for projects/groups activities rss feed.

    Can I add the the rss tests with this MR?

  • @khim.tieu.philippe please submit these tests as a separate merge request, because they are not related to this feature.

  • Okay i'll submit a new MR.

  • @smcgivern pinging you in an ongoing community contribution.

  • Please register or sign in to reply
    Loading