Hello! If you are reading this there is some possible causes why.
This guide is made by Patryk Adamczyk.
This is PAiP Web Developer Guide version 1.0.0.
If you find something which doesn't make sense, it's in too complicated language even for programmer or
anything just make Issue on GitHub.
It's for people to read how we working in PAiP Web and what rules we are trying restrict ourselves too for making better code.
It's for making my CR easier process and making place rules for making better code which i find along my path of Developer.
Have a good lecture
This is special section for dictionary with definitions of more complicated elements or just short versions of some names.
So someone one time long ago though about Git as good tool and found good solution for naming branches and complete workflow. It’s called GitFlow. People liked that and made own ways of this workflow to fit them better. That’s start of our workflow.
I will write about our flow only. If you will want to learn about GitFlow go to section FF maybe you will find something useful for you there.
So everything starts from 2 base branches:
master - Holding your
current
stable state of Projectdevelop - Holding
your
current development state of ProjectNote:
If you are administrator of Project then these 2 branches you want to make as protected branches.
Master branch should hold history of
releases.
Develop branch should hold history of development of releases.
So now you would want to make some new feature.
developdevelopmaster or PR and merge to
master
afterwards add tagOk so that’s the workflow with features let’s destruct it into smaller and easier to understand parts.
Make feature branch of develop
Feature branches have this naming scheme based on your project needs. If you don’t know what
naming
convention project uses just ask in Issue.
Naming Conventions for Feature Branches:
feature/<name-of-feature>feature/<source-like-trello>/<name-of-feature>feature/<source-like-trello>/<identifier-of-task>feature/<source-like-trello>/<identifier-of-task>/<name-of-feature>
feat/<name-of-feature>feat/<source-like-trello>/<name-of-feature>feat/<source-like-trello>/<identifier-of-task>feat/<source-like-trello>/<identifier-of-task>/<name-of-feature>
issue-<number-of-issue-on-git-issue-board-like-github>issue/<number-of-issue-on-git-issue-board-like-github>issue-<number-of-issue-on-git-issue-board-like-github>/<name-of-feature>
Examples for PWBS Project in time of writing:
issue-x/gitlab-ciissue-7/command-runner-fixesfeat/trello/Jfq3zI8z/38-docker-containerJust write your code. Just that what you want to change or make.
After your work make a PR from
your
branch to develop. If you are working alone on Project you may want to just
merge your
branch to develop manually. I don’t advice that but there is possibility if you
really
would need to.
After some features, fixes and all other work make stable release.
change Changelog
about
Changelogs we will talk about in section 4, for now just know that it exists and it is
needed to be
changed on release.
After that make PR (same thing what to 2 applies everywhere) from develop to
master
After merge of this PR add tag to repository with version as name. (for example
v.0.1.0
or just 0.1.0).
In some cases you need to use release
branches
to support and bugfix some versions of your project.
If you are working on something big you might just work on special branch for version you are build.
Made
from develop branch like v.<version>.x (for example
v.0.6.x).
But if you want to maintain your older versions or just make them as branches for documentation.
Then name your release branches in one of these ways:
release/<release-version>version/<release-version>This ways is not adviced but sometimes it can be the best for temporary release branch for example:
v.<release-version>
<release-version>If you need to fix something on stable version for temporary fix while you are working on better fix in next stable release. You should use hotfix branch.
Hotfixes are handled this way:
Make a new hotfix branch based
on
master
Hotfix Branch Name Convention:
hotfix/<name-of-issue-which-you-are-fixing>hotfix/<source-like-trello-or-github>/<identifier-of-task>hotfix/<source-like-trello-or-github>/<identifier-of-task>/<name-of-issue-which-you-are-fixing>
Fix what you need to fix
Change changelog, Make PR
Merge it, Release new version of Project, add tag on repository
git init -
Initialization
of Local Repository
git add <File> -
Add
file to changes staged for commiting
git add -A - Add all
changed files to changes stage for commiting
git commit -m "<message>" - Commit staged changes to your Local
Repository
git remote - Managing
Remote Repositories connected with current Local Repository
git remote add <name> <repository-url> - Connect Remote Repository
with
current Local Repositorygit remote rm <name> - Disconnects Remote Repository with current Local
Repositorygit remote show <name> - Shows information about Connection with Remote
Repositorygit push - Push
Local
Repository to Remote Repository
git push <remote> <branch> - Push Branch of Local Repository to Remote
Repository
git push -u <remote> <branch> - Set Remote Repository Branch to default
to
this one on this branch and push Local Repository to Remote Repository
git pull - Pull
Changes
from Remote Repository to Local Repository
git checkout <file> - Restore specified file to state before current changes
git checkout <branch> - Restore state of current branch changes of specified
branch
git tag <name>
-
Tags current changes (commit) with specified name
So you want to make some functionality. Now how to do it properly?
We will skip parts of clean Git Workflow because it was covered in previous chapter. But we will reference to it.
So let’s say you want to make new powerful Watcher Mode for <abbr title=“PAiP Web Build System”>PWBS</abbr>. Now what you should do to start doing it properly?
Firstly make fork of repository if you haven’t
done it. (People accepted to PAiP Web Open Team or PAiP Web Core Team may skip it because they might be able
to work on original repository if they ask for it)
After that clone repository to some folder. (The best just clone development branch because there you will
be working [git clone -b <development_branch> <repository_url>]).
When you have done it make new feature branch in way specified in previous chapter.
Make your awesome Watcher Mode functionality.
So you done your functionality? Ok let’s slowly get into this chapter real topic.
Firstly push all your changes to your branch.
(For sure commit from time to time the best is to commit every working part of functionality)
Now make PR from your branch back to development branch.
In Title one short sentence what functionality you have done. In Description write more in details what you
have done and if you had problem with something then with what and how next time we would have helped
you.
On GitLab if you want you can add how much time you spent on this task (with all elements where you was
stuck and etc.) simply by putting /est <time> in comment.
Ok, so you made your PR. For sure if project have CHANGELOG and things in that kind of thing make sure you
added what you have done to it.
Next what you need to do is wait or just ask for Code Review of PR. In PAiP Web for that part are PAiP Web
Admins which have to approve PRs.
After Code Review if there was need for fixes then fix elements specified and move back to waiting or asking
for next Code Review. If your code went through Code Review fine then it will be merged.
Here are some options which you can use:
`${major}`
`${major}.${minor}`
`${major}.${minor}.${patch}`
`${major}.${minor}.${patch}.${build}`
`${major}.${minor}.${patch}+${metadata}
`${major}.${minor}.${patch}-${release_type}${release_level}`
`${major}.${minor}.${patch}-${release_type}${release_level}+${metadata}`
0.* -
This is version for initial development. This version means that anything may
change at any time and anything under this version shouldn’t be considered
stable.1.0 -
This is first release version. This version means that base of thing which you
are building is considered stable enough that can be run or used on production
environment.dev
alpha
or a
beta
or b
rc or
candidate
M1 - These rules apply only for major > 0API
- If it is anything with public API interfaceUI -
If it is anything frontend related ( meaning everything which user can interact with as part of
application )Text
- If it is anything text related ( meaning things like books, documentation etc. )The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
major,
minor, patch, build and release_level are
non-negative integers, and MUST NOT contain leading zeroes. Each element MUST increase
numerically. For instance: 1.9.0 -> 1.10.0 -> 1.11.0.'1' < '2'
'1.1' < '1.2'
'1.1.1' < '1.1.2'
'1.1.1.1' < '1.1.1.2'
'1.1.1+20130313144700' == '1.1.1+exp.sha.5114f85' // Metadata is ignored
'1.1.1-dev1' < '1.1.1-dev2'
'1.1.1-dev2' < '1.1.1-alpha1'
'1.1.1-dev2' < '1.1.1-beta1'
'1.1.1-dev2' < '1.1.1-rc1'
'1.1.1-dev2' < '1.1.1-rtm1'
'1.1.1-dev2+20130313144700' == '1.1.1-dev2+exp.sha.5114f85' // Metadata is ignored
'1.2' < '1.2.1.2'
'1.2' > '1.2-dev2'
/*
* Precedense is on side of `1.4-dev1` but through package managers
* should be used `1.3` because `1.4-dev1` is pre release
*/
'1.3' < '1.4-dev1'
A changelog is a file which contains a curated, chronologically ordered list of notable changes for each version of a project.
To make it easier for users, contributors and everyone to see precisely what notable changes have been made betwwen each release (or version) of the project.
People do. Whether consumers or developers, the end users of software are human beings who care about what’s in the software or anything else that need changelogs and versions. When it changes, people want to know why and how.
Informations - for specifing informations about specific releaseAdded - for new featuresChanged - for changes in existing functionalityDeprecated - for soon-to-be removed featuresRemoved - for now removed featuresFixed - for any bug fixesSecurity - for any fixes related to security vulnerabilitiesRegression - for changes that are regressionsUnreleased Release BlockYYYY-MM-DD)It should be one of the following:
CHANGELOG.md - PreferedCHANGELOG.rstHISTORY.md / HISTORY.rstYanked releases are versions that had to be pulled because of a serious bug or security issue.
They should be noted in changelog as [YANKED] after version and date.
# Changelog
## [1.0.0] - 2017-06-20
### Added
- New feature A
### Changed
- Feature B to have additional power