Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 738 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What are the best practices for a small distributed team which will work on a Drupal project?

#1
after some research, we opted for working with Drupal on our next project and we are a distributed team.

Since Drupal stores (based on what we saw until now) all it's content on a database, how can we, as a distributed team work together on this project? What are the best practices we should take?

We thought about using a shared database server for this task, but it whould simply destroy the performance we should need to get this project going. Any suggestions about that?
Reply

#2
**First off, best practices.**

You should always consider your live database the master. You can use database dumps to get this live database each member of your distributed team. This ensures that each member of the team is working from the same base.

You should use a a version control system to share your code, so that you are all working from the same codebase but have control over when to merge the code.

Sharing a database between developers, and or sharing a codebase between developers will cause confusion and should be avoided.


**Now some more opinion based thoughts**

Content for your site should be created and edited on the live server.

You should release the code in a managed, repeatable way. Ideally you should have a staging server to test the code before it goes live.

The tricky part is content and configuration changes. I have advocated that these should be done in update functions in a dummy module. However sometimes this is arduous to do, or in some cases changes can't be done reliably. So there should be a balance, most configuration changes should be done in code, so they are repeatable and can be distributed among developers easily. But for configuration changes which are not easily coded, or which are required outside of a release window you can make them directly on the live server. The important thing is that you can get your code and database into a consistent state across development and live.





Reply

#3
Jeremy's answer (+1) is already quite comprehensive. Some additional more practical-oriented advice follows in *no particular order*.

***Disclaimer:*** this is stuff that works for me. Others might have other suggestion or even disagree. If this is the case I would be superhappy to hear feedback and alternate/better proposals!

1. **Make a point that every team member should start his/her session by updating the code AND database.** You can easily script all of that with a combination of `ssh` and `rsync` commands. I at times create a single script (`update-project.sh`) that updates the code from the repository and download and import the latest DB from the master server at once.

2. **Never forget to call `http://example.com/update.php` every time you update the code.** Run this command on your staging site, after every commit, and on your local machine after every update/pull/checkout.

3. **Do any change to the DB via SQL query, rather than with a GUI.** That way you will simply have to wrap that query into an [`hook_update_N()`][1] implementation in your *yourmodule.install* file, and you are safe and sound (if you abide to point #2!) [some gui tool output the equivalent... that's handy too!].

4. **Whenever possible, include in [`hook_update_N()`][2] also changes to module settings.** This is not possible all the times. When not possible: see point #7 and #8.

5. **When creating or modifying a view, export it to a file when finished.** Same principle that point #3 but applied to views. This approach has incidentally also the benefit of providing a rollback mechanism in case you later realise you made a mistake.

6. **Use a master repository.** Don't go for a too much distributed versioning system. Pull and push your code always from the same central repo.

7. **Always include a comment in your commit.** Especially if some code change change some functionality / API / common logic, make a point to include a warning in your commit message. Detailed info can be put in a changelog.txt file, if needed.

8. **When committing, immediately reproduce on the master DB any hand-made DB changes that you haven't managed to include in your `hook_update_N()` implementation.** This is a must if your team members start their sessions like described in #1.

9. **Be selective in what you put under versioning.** For example: exclude the `sites/default/settings.php` but evaluate what (if anything at all) need to be versioned from in `sites/default/files` (are images needed for development? and attachments?).

10. **There are some useful contributed modules that can help.** Like [import/export][3], which allows you to manage in a repository your CCK and Views or [node export][4] that allows you to export nodes and then import them back in another drupal installation.

11. **Use the [simpletest module][5] extensively.** That is a **good** idea anyhow, but when working in team is a **great** idea: that way you will be sure your changes haven't broken anybody else's work.

12. **Have fun!** I love to work in team and I believe one should try to do that everytime he/she can. It's more fun, more learning and above all... better code! :)

Bonus point (does not refer to team development specifically):

- **Try not to use your staging server for real content insertion.** Ideally you should start creating content only when the code is somehow freezed or use an import routing/module: drupal scatters information across tables a lot, and the system of hooks makes very difficult to track which modules have stored what information where: if you develop on a DB with real data, you will inevitably end up breaking some tables at some point, and you might realise that only the day before going into production. :(


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:

[To see links please register here]

[5]:

[To see links please register here]

Reply

#4
Simpletest is an invaluable tool as a developer who's working on module "A" can run the test suite and be sure he/she has not broken module "B" and then commit (for example). See the Simpletest module and Selenium IDE. Test driven development pays off in more ways than one. Developers gain confidence and can work faster/better.

Some good issue tracker and/or project management software can keep all the project info centralised and facilitate communication between developers. A wiki is good too. Emails between project managers and individual developers don't keep everyone in the loop and can get lost in time, in a noisy email environment.

I like developer chat rooms for distributed projects. Chatting in real time is very handy. Some version control can write commit messages to chat rooms.

The backup_migrate module is handy to grab the latest DB fixture off the production server. Of course you can export through mysqldump etc but this little module is a no brainer.

Check out doxygen too. Force your developers to write to that format. And pay attention to the drupal coding standards. There is a module called "coder" than can check it.
Reply

#5
I see this is an OLD post with regards to Drupal configuration management.
For now in 2013 I will definitely recommend going full with the features module. This allows you to place configuration in code and use version control (I recommend git) to pass the files across your environments.
There are a few caveats but it works for the most part. For the caveats, using the tips mentioned in the accepted answer will help to mitigate the confusion
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through