Action |
Command |
NEW MODULE
|
Contibute your own module to the community so that the world can use it (as a contrib module).
- Login to Drupal.org with your Drupal account
- Navigate My Account > Your Projects > Add a new project > Module Project [OR] Direct Link
- Provide module related inputs:
- Name: Download On-The-Fly
- Project Type: Select appropriate value
- Full Project (Ready to use project)
- Sandbox Project (Experimental code not yet ready to use)
- Short (Machine Name): download_otf
- Images: Upload supporting image that describes the Module (Optional)
- Project Classification:
- Maintenance status: Choose appropriate value
- Development status: Choose appropriate value
- Module Categories: Choose appropriate value
- Description: Describe Module in detail
- Click SAVE
- Now we will land to project page say, https://www.drupal.org/project/<module_machine_name> with below message(s):
- Module project <Module_Human_Readable_Name> has been created.
- The Git repository for this project has been enqueued for creation. It should be available in a few seconds.
Check Contribute Custom Module
Check Release Module
|
CONTRIBUTE CUSTOM MODULE
|
Contributing code is an important and effective way to improve your learning, your code in various ways.
Also, it is best to share your code with the world of open-source, so that one need not require to re-invent the wheel.
So, if you think the custom module you have recently worked on has a generic solution and is re-usable, then contribute it today!
Also check Contribution PTR
Check New Module
Check Find Repository
cd /path/to/module
git init
git remote add origin git@git.drupal.org:project/download_otf.git
git remote -v
origin git@git.drupal.org:project/download_otf.git (fetch)
origin git@git.drupal.org:project/download_otf.git (push)
git checkout -b 8.x-1.x
git add .
git status
Check Git Configuration
git commit -m "Initial Commit."
git log
git push -u origin 8.x-1.x
Check Release Module
|
MODULE REVISIT
(ADD NEW FEATURES)
|
Module repositories are public for collaboration. Owner or Maintainer of the project can push the code,
whereas others can work on the shared code and create patch for adding new feature or bug fixes.
Being owner of the module lets add new features to the module and release another version of the module.
cd /path/to/module
Check Find Repository & Branch Details
git init
git remote add origin git@git.drupal.org:project/download_otf.git
git remote -v
origin git@git.drupal.org:project/download_otf.git (fetch)
origin git@git.drupal.org:project/download_otf.git (push)
git checkout -b 8.x-1.x
git pull
At this point, we are ready to make changes to the module and test the working of the changes we made so far.
git add .
git status
Check Git Configuration
git commit -m "Introducing external vendor library support for file data generation"
git log
git push -u origin 8.x-1.x
Check Release Module
|
RELEASE MODULE
|
Its time to release your module to the world.
Module's are released at specified repository tags.
Example, if we are interested in releasing 8.x-1.0 version of your module, then we will need to introduce 8.x-1.0 tag to the repository. Learn more on Git tags
git log
git tag -a 8.x-1.0 -m "First version of the module"
git push origin tag 8.x-1.0
- Login to Drupal.org with your Drupal account
- Click on ‘Add new release’ link at the very bottom of the respective module's page
- Gitlab release tag or branch: Choose the created tag 8.x-1.0
- Click NEXT
- Release notes: Add release details
- Short description: Add short description
(This appears just above tar/zip download links on the page)
- Release type: New features
- Click SAVE
- Come back to module's page and find your released Module. Hurray!
|
NEW ISSUE
|
If we face any issue or want to report bug let the Drupal community know.
Not only bug we can also request a new module feature.
To do so, we need to create a new issue.
- Login to Drupal.org with your Drupal account
- On modules page at the right region block under 'Issues':
- Search for issue before submitting a new issue to avoid duplicates
- Also, see 'All issues' already raised
- If no related issues found create a new one by clicking on 'Create a new issue'
- Provide inputs for the Issue form:
- Title: Give suitable issue title
- Category: Select appropriate option
- Priority: Select appropriate option
- Status: Active
- Version: Select appropriate module version
- Component: Select appropriate option
- Assigned: If we are working on this issue then assign to self or leave it Unassigned
- Issue Tags: Search issue related tags and add Issue
- Summary: Describe the issue
- File: Upload image or file that describes the issue (Generally used to share patch)
- Click SAVE
|
NEW PATCH
|
Patches should be submitted via the issue tracker, i.e., there should exists an issue against which a patch shall be submitted.
Create A New Issue to report bug or request a feature and then only introduce a patch against it.
Also, check what is Revised Patch?
Learn more on Git Patch.
cd /path/to/module
git init
git add .
git status
At this point, make all your changes to the module files and test the working of the changes we made so far.
Check Naming Patch
git diff --cached > download_otf_text_examples_3124918_7_D8.patch.patch
Check Submit Patch
rm -rf .git
|
SUBMIT PATCH
|
It is advised to test patch files locally before submitting.
Learn more on Git Patch.
Once your patch and/or interdiff file(s) are ready and tested, submitting patch is an easy step.
- Login to Drupal.org with your Drupal account
- Go to respective issue page, and submit 'Add new comment' form:
- Issue Metadata (Status): Needs Review
- Comment: Add suitable comment
- Files: Upload patch and/or interdiff file (one by one)
- Click SAVE
|
REVISED PATCH
|
Sometimes, against an issue, a patch is available but that is partial or some update is required.
In this case, one can submit a revised patch.
Learn more on Git Patch.
cd /path/to/module
git init
git add .
git status
git commit -m 'Module initial state.'
curl https://www.drupal.org/files/issues/2020-04-04/download_otf_text_examples_3124918_2_D8.patch | git apply
git add .
git status
git commit -m 'Module state after applying existing patch.'
At this point, make all your changes to the module files and test the working of the changes we made so far.
Check Naming Patch
git diff > interdiff-3124918-2-7.txt
git diff HEAD~1 > download_otf_text_examples_3124918_7_D8.patch.patch
Check Submit Patch
rm -rf .git
|
RESOLVE ISSUE
(OWNER/MAINTAINER)
|
Owner or Maintainer of the module can resolve the issue by applying patch and release a new version of the module.
These patches might have been provided by some contributor or we can create on your own.
cd /path/to/module
Check Find Repository & Branch Details
git init
git remote add origin git@git.drupal.org:project/download_otf.git
git remote -v
origin git@git.drupal.org:project/download_otf.git (fetch)
origin git@git.drupal.org:project/download_otf.git (push)
git checkout -b 8.x-1.x
git pull
Check Examine Patch
pwd
git add .
At this point, we are ready to commit and push the code, but wait!
Resolving issue requires conventional commit message, check below steps.
- Login to Drupal.org with your Drupal account
- Go to respective issue page within 'Add new comment' form (DO NOT SUBMIT)
- Update Credit & committing section
- Giving credit to:
Opt checkboxes against the contributors (we want to credit to), and
Opt (radio button) the patch author
- Credit others could be used to search and credit other contributors as well
- Now, at the very bottom of the form copy the commit message under 'Git command' vertical tab.
- DO NOT Click SAVE
git commit -m 'Issue #3124918 by abhaysaraf: How to use? (Working examples)' --author="abhaysaraf <git@2723079.no-reply.drupal.org>"
git push origin 8.x-1.x
Check Release Module
Huh! We are pending with one last important task.
Which is updating the issue status on Drupal.org, along with crediting the patch contributor(s) for their time and effort. So, let's do that.
- Login to Drupal.org with your Drupal account
- Go to respective issue page, and submit 'Add new comment' form:
- Update Issue Metadata section
- Status: Fixed
- Assigned: Unassigned
- Update Credit & committing section
- Giving credit to: Opt checkboxes against the contributors (we want to credit to)
- Credit others could be used to search and credit other contributors as well
Important: A comment for each contributor will be added and they will be notified
- Click SAVE
- Note: Issue will automatically get closed with status 'Closed (fixed)' in 2 weeks if no activity.
|
NAMING PATCH
|
A convention or nomenclature is followed to name patch files.
This helps other contributors to collect patch information in a quick glance.
{project_name}-{issue_short_detail}-{issue_nid}-{expected_next_comment_number}-{drupal_version}.patch
download_otf_text_examples_3124918_7_D8.patch.patch
interdiff-{issue_nid}-{last_patch_comment_number}-{expected_next_comment_number}.txt
interdiff-3124918-2-7.txt
TIP:
Q. How to get 'issue_nid'?
- Get it from issue page URL, as a issue number.
Q. How to get 'expected_next_comment_number'?
- On the respective issue page, in the comment-form a number appears just after 'Add new comment #'.
Q. How to get 'last_patch_comment_number'?
- It is the comment number of the patch against which we created a revised patch.
|
EXAMINE PATCH
|
It is good practice to test the patch files locally before submitting or resolving an issue.
Learn more on How to apply Patch?.
Additionally, Dreditor (Browser Extension) helps in quickly reviewing both patch & interdiff file in the respective issue page itself.
cd /path/to/module
curl https://www.drupal.org/files/issues/2020-06-19/download_otf_text_examples_3124918_7_D8.patch.patch | git apply
At this point, patch has been applied successfully.
And we are now required to test the working of the respective module locally.
Your patch seems to be a valid patch if module behaviour is as per the expectation.
|
FIND REPOSITORY
|
Module repositories are public for collaboration. Drupal manages project repositories at git.drupalcode.org.
- Visit Drupal.org
- Go to respective module's page
- Click on Version Control tab
- Here we will find repository and other details along with essential Git commands for working with the project
- Additionally, you can login with your Drupal account to explore more
- Visit Git Drupal.org
- In search box, search with your module's machine name
- Select your module from the list to get overview and repository details
- Additionally, you can login with your Drupal account credentials to explore more
|
GIT AUTHENTICATION
|
Setting up SSH is recommended for authenticating with Drupal's Git repositories.
Otherwise, while code collaboration Git will prompt you to authenticate using your Drupal account password
Learn more.
Check SSH key
ssh-keygen -t rsa -b 4096 -C Drupaldrug
cat ~/.ssh/id_rsa.pub
- Login to Drupal.org with your Drupal account
- Navigate My Account > Profile > SSH keys (sub-tab) > Add a public key
- Title: Give appropriate key title
- Key: Paste here the copied 'Public SSH' key
- Click SAVE
Note: The very first time you try make git actions to drupal git-repositories;
Your system does not know Drupal.org's public key and will prompt
'Are you sure you want to continue connecting (yes/no)?', be sure to type 'yes'.
|
GIT CONFIGURATION
|
It is important to configure Git using registered or anonymized email, or else you will not be credited in commit statistics or listings.
Also check anonymized email .
- Login to Drupal.org with your Drupal account
- navigate to My Account > Profile > Edit (sub-tab) > E-mail addresses
Attention! Git allows to configure user details per project/repository basis or accross all projects in your machine.
This can be updated at any point of time.
Learn more
git config user.name "Your Name"
git config user.email "your email"
git config --global user.name "Your Name"
git config --global user.email "your email"
|
SECURITY COVERAGE
|
It is advised to take security coverage for your contributed modules Learn more.
While submitting your module, 'Opt into security advisory coverage' option remain disable for next 10 Days,
then after, we can opt into this coverage following given steps.
- Login to Drupal.org with your Drupal account
- Click on ‘Edit’ tab on the concerned module's page
- Find 'Security advisory coverage' under Project Classification section
- Select 'Opt into security advisory coverage'
- Click SAVE
|
ANONYMYZED EMAIL
|
Drupal provisions an 'Anonymized Drupal Email' for collaboration.
Since, Email addresses in Git repositories can be accessed by anyone looking at the Git log.
Hence, as per your preference you can use an anonymized address instead of your real email address.
Anonymized address look somewhat like 'git@2723079.no-reply.drupal.org'.
- Login to Drupal.org with your Drupal account
- Navigate My Account > Profile > Git access (sub-tab)
- Find it under 'Git Configuration' section
|
CONTRIBUTION PTR
|
Points to remember while contributing to the Drupal community.
- Is file README.txt added?
- Is file composer.json (Composer support) added?
|
https://www.drupal.org/docs/distributions/degov/semantic-versioning-model
ReplyDeleteMODULE REVISIT (ADD NEW FEATURES)
ReplyDeleteUPTADE FROM:
# Switch to appropriate branch and pull the code
git checkout -b 8.x-1.x
git pull
TO:
# Switch to appropriate branch and pull the code
git checkout -b 8.x-1.x
git add .
git pull origin 8.x-1.x
# Take an example case of my Download On-The-Fly (download_otf) custom module
ReplyDelete# First you need to create a Module Node
Check New Module
# Be ready with the module's repository details created in previous step
Check Find Repository
# We believe that the custom module is ready and already installed locally
# Now, go to the respective module directory
cd /path/to/module
# Initialize git for collaboration
git init
git remote add origin git@git.drupal.org:project/download_otf.git
# Check remote once
git remote -v
origin git@git.drupal.org:project/download_otf.git (fetch)
origin git@git.drupal.org:project/download_otf.git (push)
# Create a new branch
git checkout -b 8.x-1.x
# Now, stage all module files and check the status
git add .
git status
# Before committing the code- configure Git with correct user name/email
Check Git Configuration
Profile >> GIT ACCESS
Get you no-reply email Email addresses in Git repositories can be accessed by anyone looking at the Git log. It is generally considered appropriate to use a real, public-facing email for Git. If you prefer to use an anonymized address, use:
https://drupaldrug.blogspot.com/2020/06/drupal-contribution.html#dd-heading-security-coverage
ReplyDeleteThis may take half a day to reflect. By that time you may see message on composer
You are using Drupal packages that are not supported by the Drupal Security Team!
- drupal/colorpalette:1.0.2.0: Project has not opted into security advisory coverage!
Make sure u have minimum
ReplyDeletemodule.info
composer.json
Nice Blog, it is very Impressive.Keep Sharing With us.
ReplyDeleteDrupal Course in Chennai
Drupal Course in Bangalore
See https://drupal.org/project/config_inspector for a module to help with debugging your schemas. The module helps find missing schemas and schema elements with various views on your data and schema.
ReplyDeleteCode style to use for schema files https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-schemametadata#codestyle
Deletedrush config:inspect --detail --only-error
DeleteSecurity issues should not be reported as a general issue. Follow the procedure for reporting security issues https://www.drupal.org/node/3156997.
ReplyDeleteSemantic Versioning -- MAJOR.MINOR.PATCH -- https://semver.org/
ReplyDelete