In the Git tests, we see that a project creator can init, push and pull to repos. We need to see that the Write to VCS permission grants the right permissions to a non-owner.

  • Maintainers: permissions changes - Change permissions and save, they should remain.
  • Maintainers: permissions verify write - Verify write to VCS does not work when terms of service are not agreed to.
  • Maintainers: permissions verify write - Verify write to VCS works with git user, git vetted user, and admin test.
  • Issue queue: write - You can create issues - verify you can create the create issue page, but don't take this any further as it's subject to major change.
  • We need to add tests for the other pemission to this issue

    Feature: Add additional maintainers with appropriate permissions
    In order to get help maintaining my project
    As a project owner
    I need to be able to add people to my project with appropriate permissions

    Check the owner can
    Add and delete maintainers
    Assign Write to VCX, Edit project, Administer maintainers, Maintain issues

    Feature: Co-maintain a project
    In order to help maintain a project
    As a non-owner
    I need to be able to participate in accordance with the permissions I've been granted
    Test the above for each permission set.

    Comments

    kssundar’s picture

    Assigned: Unassigned » kssundar
    Issue tags: +sprint 6

    The project considered to test this feature will be mentioned as the "post title" parameter in yml file.

    Taking this one.

    kssundar’s picture

    Assigned: kssundar » eliza411
    Status: Active » Needs review

    Could not find any step definitions to test "Write to VCS" functionality. I guess it includes git "add", "commit" and "push".

    Currently I will skip this permission and continue with other permissions.

    eliza411’s picture

    Status: Needs review » Needs work

    There is no step definition specifically testing Write to VCS. It will require adding and committing locally, and the test will be a successful push.

    eliza411’s picture

    Assigned: eliza411 » Unassigned

    Unassigning from me.

    kssundar’s picture

    Title: Verify that the Write to VCS permission works » Verify Maintainers tab and its permissions
    Assigned: Unassigned » eliza411
    Status: Needs work » Needs review

    Committed to repo - http://drupalcode.org/project/doobie.git/commit/c8fbdcd

    Only two features are committed.
    project_maintainers_tab.feature - checks for contents and functionality on the page
    project_maintainers_tab_edit.feature - assigns edit permission to maintainer and confirms the same

    Please review the above two. After it is ok, then I will commit the features containing other permission checks.

    kssundar’s picture

    Title: Verify Maintainers tab and its permissions » Verify Maintainers tab and its permissions (project_maintainers_tab.feature, edit, vcs, maintainers, issues, releases)

    Added the remaining features:
    project_maintainers_tab_vcs.feature - assigns Write to VCS permission to maintainer and confirms the same (Worked for me only on VMware! )
    project_maintainers_tab_issues.feature - assigns Administer issues permission to maintainer and confirms the same
    project_maintainers_tab_releases.feature - assigns Administer releases to maintainer and confirms the same
    project_maintainers_tab_maintainers.feature - assigns Administer maintainers to maintainer and confirms the same

    Committed here - http://drupalcode.org/project/doobie.git/commit/9581b89

    eliza411’s picture

    Assigned: eliza411 » Unassigned
    Status: Needs review » Needs work

    project_maintainers_tab_edit.feature and project_maintainers_tab_vcs.feature are right, but all the other files are not using Unix-compatible line endings and need to be revised so they do.

    The actual content of the files it looking great, although project_maintainers_tab_vcs.feature needs to clean up after itself so that the repository it creates is removed at the end of the scenario.

    kssundar’s picture

    Assigned: Unassigned » kssundar
    Issue tags: +sprint 7

    tagging

    kssundar’s picture

    converted to unix format and committed - http://drupalcode.org/project/doobie.git/commit/e6f8b59

    The repository folder created locally will be removed by @afterscenario @gitrepo

    kssundar’s picture

    Assigned: kssundar » eliza411
    Status: Needs work » Needs review
    eliza411’s picture

    Component: Feature/Scenarios » Step definitions
    Assigned: eliza411 » Unassigned
    Status: Needs review » Needs work
    Issue tags: +dependent scenarios

    This looks great for now and I'm moving along to code review, but I think that's going to need work because if the scenarios are run out of order, I see:

      @gitrepo
      Scenario: Git user does a push a commit to the repository  # features/project/project_maintainers_tab_vcs.feature:23
        Given I am logged in as "git user"                       # FeatureContext::iAmLoggedInAs()
        And I am on the Version control tab                      # FeatureContext::iAmOnTheVersionControlTab()
    PHP Fatal error:  Call to a member function getHTML() on a non-object in /home/melissa/doobie/features/bootstrap/FeatureContext.php on line 385

    I'll be re-visiting the test data issue with sdboyer, but in the meantime, I doing a check that the value is present and throwing a pretty exception if it is not is in order.

    I've tagged this issue with dependent scenarios and tagged each dependent scenario with @dependent.

    kssundar’s picture

    Status: Needs work » Needs review
    Issue tags: +sprint 8

    Updated feature, step definitions and added exception messages where ever necessary and committed here - http://drupalcode.org/project/doobie.git/commit/e66f1b7

    eliza411’s picture

    Status: Needs review » Needs work

    I'm getting prompted for the gituser password:

      @gitrepo @dependent
      Scenario: Git user does a push a commit to the repository  # features/project/project_maintainers_tab_vcs.feature:27
        Given I am logged in as "git user"                       # FeatureContext::iAmLoggedInAs()
        And I am on the Version control tab                      # FeatureContext::iAmOnTheVersionControlTab()
    gituser@git6.devdrupal.org's password: 
    gituser@git6.devdrupal.org's password: 
        When I clone the repo                                    # FeatureContext::iCloneTheRepo()
        Then I should be able to push a commit to the repository # FeatureContext::iShouldBeAbleToPushACommitToTheRepository()
    kssundar’s picture

    Yes, it is the same behaviour here as well. The step "I clone the repo" directly executes the repository url. We have to update it by breaking it and using gitwrapper somehow.

    kssundar’s picture

    Assigned: Unassigned » eliza411
    Status: Needs work » Needs review

    The git user password will not be prompted and the code fix is committed here - http://drupalcode.org/project/doobie.git/commit/80e72ef

    eliza411’s picture

    Assigned: eliza411 » Unassigned
    Status: Needs review » Needs work

    Looks like good progress!

    I fixed the spelling error in the exception and pushed it in 518efd6cc8732

    If the repo doesn't initialize, we get some less-than-helpful text in the subsequent failures. Can you look into that?

      Scenario: Create a sandbox project and initialize repo         # features/project/user_profile_projects_section.feature:10
        When I visit "/node/add/project-project"                     # FeatureContext::iVisit()
        And I create a "module"                                      # FeatureContext::iCreateA()
        And I see the project title                                  # FeatureContext::iShouldSeeTheProjectTitle()
        And I am on the Version control tab                          # FeatureContext::iAmOnTheVersionControlTab()
        And I initialize the repository                              # FeatureContext::iInitializeTheRepository()
          The page did not contian any code block
        And I follow "Version control"                               # FeatureContext::clickLink()
        Then I should see "Setting up repository for the first time" # FeatureContext::assertPageContainsText()
    
      @gitrepo @dependent
      Scenario: Commit to the above sandbox project and verify the same # features/project/user_profile_projects_section.feature:20
        When I visit the Version control tab                            # FeatureContext::iAmOnTheVersionControlTab()
        And I clone the repo                                            # FeatureContext::iCloneTheRepo()
          Notice: Undefined variable: url in features/bootstrap/FeatureContext.php line 207
    kssundar’s picture

    Assigned: Unassigned » eliza411
    Status: Needs work » Needs review

    The above output belongs to the issue #1706782: Profile (/user) and this still needs review! :)
    I will update the featurecontext as suggested above.

    kssundar’s picture

    Updated featurecontext with additional exception handling and committed here - http://drupalcode.org/project/doobie.git/commit/84fc619

    eliza411’s picture

    Component: Step definitions » Feature/Scenarios
    Status: Needs review » Needs work

    I read comment number #15 and reviewed the commit it linked to: features/project/user_profile_projects_section.feature instead of features/project/project_maintainers_tab_vcs.feature ... now I know how I went astray.

    So, regarding project_maintainers_tab_vcs.feature

    The exceptions are much more helpful, and I'm seeing one of them in the third scenario.
    It's consistently failing on the "I clone the repo" step as is #1706800: Edit profile tab(git_access_check.feature):

      @gitrepo @dependent
      Scenario: Git user does a push a commit to the repository  # features/project/project_maintainers_tab_vcs.feature:28
        Given I am logged in as "git user"                       # FeatureContext::iAmLoggedInAs()
        And I am on the Version control tab                      # FeatureContext::iAmOnTheVersionControlTab()
        When I clone the repo                                    # FeatureContext::iCloneTheRepo()
          The clone did not workspawn git clone --recursive --branch master ssh://gituser@git6.devdrupal.org:2020/sandbox/gitvetteduser/1780943.git znafgajp2jnfgssv
          Cloning into 'znafgajp2jnfgssv'...
          gituser@git6.devdrupal.org's password: 
          Permission denied, please try again.
          gituser@git6.devdrupal.org's password: 
        Then I should be able to push a commit to the repository # FeatureContext::iShouldBeAbleToPushACommitToTheRepository()

    Additionally, there are some given/when/then issues.

    In the first scenario, instead of:

        And I am on the Version control tab
        Then I initialize the repository

    which are both changing the state of the system, I would expect to see:

        And I am on the Version control tab
        And I initialize the repository
        Then I should see "some sign of success visible to the user"

    Likewise for the third scenario. Instead of:

        When I clone the repo
        Then I should be able to push a commit to the repository

    I would expect to see something more like:

        When I clone the repo
        And I push a commit
        Then I should see "some sign of success visible to the user"

    ~
    ~

    eliza411’s picture

    Assigned: eliza411 » Unassigned

    Unassigning - FYI, I automatically review anything that is set to needs review with a component of Feature/Scenario.

    kssundar’s picture

    Assigned: Unassigned » kssundar
    Status: Needs work » Needs review

    Updated feature according to the suggestions.

    Regarding

    When I clone the repo # FeatureContext::iCloneTheRepo()
    The clone did not workspawn git clone --recursive --branch master ssh://gituser@git6.devdrupal.org:2020/sandbox/gitvetteduser/1780943.git znafgajp2jnfgssv
    Cloning into 'znafgajp2jnfgssv'...
    gituser@git6.devdrupal.org's password:
    Permission denied, please try again.
    gituser@git6.devdrupal.org's password:

    a variable in gitwrapper got changed from "$pass" to "$argv". Changed this and committed as well.

    http://drupalcode.org/project/doobie.git/commit/3cd80d8

    kssundar’s picture

    Updated code to work with tag @clean_data.

    http://drupalcode.org/project/doobie.git/commit/4c2b8a1

    eliza411’s picture

    Component: Feature/Scenarios » Step definitions

    Looks ready for code review.

    eliza411’s picture

    merged to master

    eliza411’s picture

    Status: Needs review » Fixed

    marking fixed

    Status: Fixed » Closed (fixed)

    Automatically closed -- issue fixed for 2 weeks with no activity.

    kssundar’s picture

    Version: » 7.x-1.x-dev
    Component: Step definitions » Feature/Scenarios
    Status: Closed (fixed) » Patch (to be ported)
    Issue tags: +sprint 18

    project_maintainers_tab_vcs.feature needs 7.x update

    kssundar’s picture

    Status: Patch (to be ported) » Needs review
    eliza411’s picture

    Status: Needs review » Reviewed & tested by the community

    Removed the @wip and failure tags - these are as ready as they can be until the D7 Drupal.org is ready for feedback.

    eliza411’s picture

    Status: Reviewed & tested by the community » Closed (fixed)
    eliza411’s picture

    Issue summary: View changes

    .