WU4: Version Control API and family changes

Events happening in the community are now at Drupal community events on www.drupal.org.
marvil07's picture

I missed one WU, so what have been done since then:

  • array access really helps to migrate to OOP, so each class implements that SPL interface
  • Like it was expected, dia auto-generation only did the easy part, and like it's mentionen in WU2 I made a bulk update on each class trying map all needed functions as methods. After that I needed to make lots of manual changes, to use the methods and data members, but also fix the last ones to made relations between classes.
  • I'm using references to the "parents" on "children", instead of lists of "children" on "parents" or both approaches (like item class repository data member instead of list of items on repository). This is not definitive, but now it's like this.
  • Replace username on versioncontrol core in favor of author and commiter.
  • Use already defined database identifier names instead of "id". This is mainly for use the cool drupal_write()
  • New stuff working pushed on versioncontrol core oop branch, but like you imagine I needed a backend to test, so I used my own branch of git backend
    • Repository add/edit/delete/fetch
    • VCS Account add/list

Until now I've tried to avoid changing methods which I didn't use it in some known workflow(aka don't change without test)

So, what is left to finish OOP Version Control API?

This week target:

  • follow sdboyer suggestions
  • continue using git backend to do complete workflow
    • Repository add/edit/delete/fetch
    • VCS Account add/list
    • ?
    • commitlog working
    • commit_restrictions? how to test?
    • versioncontrol_account_status? how to test?
      (help me here to define the list of what to test)
  • after complete workflow, start implement interfaces and make it work with git backend

Comments

Tests, recap

jpetso's picture

In this week's IRC meeting, we agreed to defer further action on the OO-ification in favor of simpletests being written, so that tasks like the ones listed above (repository management, account management, etc.) can be tested and we can say with more confidence that stuff is still working.

Marco's task for the upcoming week is to create a minimal mock backend called versioncontrol_test (with hook_versioncontrol_backends() returning "test" as backend name) that enables repository and account management to work even though operations are not possible. Operation tests are assigned to Dan (dhax) who will come up with a set of commit scenarios and start to test those from the backends, starting with the Git backend and initially focusing on its hook scripts. Testing Commit Restrictions is part of operation testing, so please skip this one for now.

As for testing the Account Status module, there are a couple of use cases I can think of:

  • Create a new repository, select "User application required" in the "Authorization method" field (which effectively enables the Account Status module for this repository), and enter some text in the "Account application form messages" and "Account application e-mail messages" fields. Save the repository, visit the repository edit form again, and make sure those texts still exist in the same text fields.
  • Try to create a new account for this repository on the "versioncontrol/register" page, and make sure that the application form messages are listed there correctly.
  • Temporarily change the 'smtp_library' and implement drupal_mail_wrapper() (see the drupal_mail_send() docs on how Drupal invokes that), so that you can check for mail content. Then, create an account, test various status changes (newly created → queued, queued → approved, approved → disabled, etc.) and check if the various emails get sent to the applicant and admin.
  • If the "User application required" authorization method is not selected, the register form should not include Account Status specific application texts, no status is being set, and no emails are being sent.
  • ...and that's it!

k, gotta go, maybe more on that some other time. Good luck, looking forward to your tests!

SoC 2009

Group categories

Admin Tags

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: