Skip to content

Contributing to ExAdmin

Steve Pallen edited this page May 22, 2016 · 4 revisions

Pull requests

Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.

IMPORTANT: By submitting a patch, you agree that your work will be licensed under the license used by the project.

If you have any large pull request in mind (e.g. implementing features, refactoring code, etc), please ask first otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.

Please adhere to the coding conventions in the project (indentation, accurate comments, etc.) and don't forget to add your own tests and documentation. When working with git, we recommend the following process in order to craft an excellent pull request:

  1. Fork the project, clone your fork, and configure the remotes:

    # Clone your fork of the repo into the current directory
    git clone https://github.com/<your-username>/ex_admin
    # Navigate to the newly cloned directory
    cd ex_admin
    # Assign the original repo to a remote called "upstream"
    git remote add upstream https://github.com/smpallen99/ex_admin
  2. Pick a project to interactively see your ExAdmin changes:

  • Create your own project or use one of the two working working demos:

  • Change the :ex_admin dependency in your project to a path directive like

      def deps do
        [
          {:ex_admin, path: "../ex_admin"}
        ]
      end
  • Get the new deps and remove the old build dir

    mix deps.get ex_admin
    rm -rf build/dev/lib/ex_admin
  • Now your project should be setup to your up your local changes every time you compile your project.

  1. If you cloned a while ago, get the latest changes from upstream, and update your fork:

    git checkout master
    git pull upstream master
    git push
  2. Create a new topic branch (off of master) to contain your feature, change, or fix.

    IMPORTANT: Making changes in master is discouraged. You should always keep your local master in sync with upstream master and make your changes in topic branches.

    git checkout -b <topic-branch-name>
  3. Commit your changes in logical chunks. Keep your commit messages organized, with a short description in the first line and more detailed information on the following lines. Feel free to use Git's interactive rebase feature to tidy up your commits before making them public.

  4. Make sure all the tests are still passing.

    mix test
  5. Push your topic branch up to your fork:

    git push origin <topic-branch-name>
  6. Open a Pull Request with a clear title and description.

  7. If you haven't updated your pull request for a while, you should consider rebasing on master and resolving any conflicts.

    IMPORTANT: Never ever merge upstream master into your branches. You should always git rebase on master to bring your changes up to date when necessary.

    git checkout master
    git pull upstream master
    git checkout <your-topic-branch>
    git rebase master

Thank you for your contributions!