Page MenuHomePhabricator

Prevent wikidata descriptions from showing on non-main namespace
Closed, ResolvedPublic2 Story Points

Description

Per T127250#2286335

Wikidata descriptions currently show up on Main pages and portal pages (basically any non-main namespace). This is not intentional and a distraction to users on those non-article pages.


AC

  • The Wikidata description only appears on mainspace pages
  • The Wikidata description doesn't appear on the main page
  • There exists tests verifying the above

Event Timeline

JKatzWMF created this task.May 11 2016, 8:48 PM
Restricted Application added a subscriber: Zppix. · View Herald TranscriptMay 11 2016, 8:48 PM

Create browser tests for this.

phuedx updated the task description. (Show Details)May 16 2016, 4:32 PM
phuedx updated the task description. (Show Details)

Change 291976 had a related patch set uploaded (by Jhobs):
Make Wikidata descriptions only show up on main namespace

https://gerrit.wikimedia.org/r/291976

Moving back to Code Review despite Jenkins failing because the failing test appears to be a timeout. Already sent for a recheck.

I'm not able to run the browser tests locally or against beta cluster from my machine. Something to do with the authentication and account creation steps:

browser (review/jhobs/wikidata $%) $ MEDIAWIKI_URL=http://en.wikipedia.beta.wmflabs.org/wiki/ MEDIAWIKI_API_URL=http://en.wikipedia.beta.wmflabs.org/w/api.php bundle exec cucumber features/wikidata_descriptions.feature
@chrome @firefox @en.m.wikipedia.beta.wmflabs.org @vagrant @extension-wikibase
Feature: Wikidata descriptions

  Background:                        # features/wikidata_descriptions.feature:4
  NeedCaptcha (MediawikiApi::CreateAccountError)
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_api-0.6.0/lib/mediawiki_api/client.rb:94:in `create_account_old'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_api-0.6.0/lib/mediawiki_api/client.rb:92:in `create_account_old'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_api-0.6.0/lib/mediawiki_api/client.rb:56:in `create_account'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_selenium-1.7.1/lib/mediawiki_selenium/user_factory.rb:38:in `create_account'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_selenium-1.7.1/lib/mediawiki_selenium/user_factory.rb:30:in `create'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_selenium-1.7.1/lib/mediawiki_selenium/helpers/user_factory_helper.rb:34:in `block (2 levels) in <module:UserFactoryHelper>'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_selenium-1.7.1/lib/mediawiki_selenium/helpers/api_helper.rb:17:in `api'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_selenium-1.7.1/lib/mediawiki_selenium/helpers/api_helper.rb:39:in `missing_extensions'
  /Users/jhernandez/.rvm/gems/ruby-2.1.1/gems/mediawiki_selenium-1.7.1/lib/mediawiki_selenium/cucumber/hooks.rb:49:in `Before'
    Given I am using the mobile site # features/step_definitions/common_steps.rb:54
      {"errorMessage":"Unable to set Cookie","request":{"headers":{"Accept":"application/json","Accept-Encoding":"gzip;q=1.0,deflate;q=0.6,identity;q=0.3","Connection":"close","Content-Length":"116","Content-Type":"application/json; charset=utf-8","Host":"127.0.0.1:8910","User-Agent":"Ruby"},"httpVersion":"1.1","method":"POST","post":"{\"cookie\":{\"name\":\"mf_useformat\",\"value\":\"true\",\"secure\":false,\"path\":\"/\",\"domain\":\"en.wikipedia.beta.wmflabs.org\"}}","url":"/cookie","urlParsed":{"anchor":"","query":"","file":"cookie","directory":"/","path":"/cookie","relative":"/cookie","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/cookie","queryKey":{},"chunks":["cookie"]},"urlOriginal":"/session/76417d20-27eb-11e6-86ab-a315a6ce0be5/cookie"}} (org.openqa.selenium.UnableToSetCookieException) (Selenium::WebDriver::Error::UnableToSetCookieError)
      ./features/step_definitions/common_steps.rb:59:in `block (2 levels) in <top (required)>'
      ./features/step_definitions/common_steps.rb:55:in `/^I am using the mobile site$/'
      features/wikidata_descriptions.feature:5:in `Given I am using the mobile site'
    And I am on the "Main Page" page # features/step_definitions/common_steps.rb:48

  Scenario: Description does not appear on Main Page # features/wikidata_descriptions.feature:8
    Then I should not see a wikidata description     # features/step_definitions/wikidata_descriptions.rb:5

  Scenario: Description appears on main namespace # features/wikidata_descriptions.feature:11
    When I am on the "Albert Einstein" page       # features/step_definitions/common_steps.rb:48
    Then I should see a wikidata description      # features/step_definitions/wikidata_descriptions.rb:1

  Scenario: Description does not appear on non-main namespaces # features/wikidata_descriptions.feature:15
    Given I am on the "Talk:Contributions" page                # features/step_definitions/common_steps.rb:48
    Then I should not see a wikidata description               # features/step_definitions/wikidata_descriptions.rb:5

  Scenario: Description does not appear on special pages # features/wikidata_descriptions.feature:19
    Given I am on the "Special:Contributions" page       # features/step_definitions/common_steps.rb:48
    Then I should not see a wikidata description         # features/step_definitions/wikidata_descriptions.rb:5

Failing Scenarios:
cucumber features/wikidata_descriptions.feature:8 # Scenario: Description does not appear on Main Page

4 scenarios (1 failed, 3 skipped)
15 steps (1 failed, 14 skipped)
0m8.090s

Not sure if it's just my setup.

Locally I'm not able to successfully install the wikidata role, so running the tests complains about the missing wikibase extension obviously.

Here's my log locally when provisioning after enabling the role, seems like there is a mismatch between elastic 1.7 and 2 somewhere. I'm getting very tired of this. I'm about to blow up my mediawiki-vagrant installation...

Judging by the error message the bug T129472 may still be alive. @zeljkofilipin can you help us out here?

@joakino for future - you can disable the ConfirmEdit extension or ensure all your environment variables are set NeedCaptcha

I got these running and documented how here and here
A minor issue needs fixing.

@jhobs please fold the changes into https://gerrit.wikimedia.org/r/292190 into your patch and I can confirm this is then ready to go.

phuedx removed jhobs as the assignee of this task.Jun 2 2016, 3:04 PM
phuedx added a subscriber: jhobs.
phuedx added a comment.EditedJun 2 2016, 4:41 PM

I've submitted a small follow-on hygiene change for @jhobs' review: 292371: Don't check namespace twice

dr0ptp4kt closed this task as Resolved.Jun 5 2016, 7:03 PM
dr0ptp4kt claimed this task.
dr0ptp4kt updated the task description. (Show Details)

Signing off.