From Fedora Project Wiki

m (Use condensed git push command (suggested by kparal))
(add git branching description)
Line 1: Line 1:
This page describes the process for tagging, building and deploying a new version of autoqa.  This page assumes a basic understanding of rpm {{filename|spec}} file syntax and commands such as {{command|git}}, {{command|mock}} and {{command|yum}}.
This page describes the process for tagging, building and deploying a new version of autoqa.  This page assumes a basic understanding of rpm {{filename|spec}} file syntax and commands such as {{command|git}}, {{command|mock}} and {{command|yum}}.


== Update {{filename|autoqa.spec}} ==
== Numbering scheme ==
Once the decision has been made to release a new version of autoqa, the first step is to update the rpm {{filename|spec}} file with the newer version.
 
Each release has X.Y.Z identification denoting a major, a minor and a revision number:
 
* Major number is increased when AutoQA makes incompatible changes in its test API. (Not used currently, since no stable public API has been offered yet.)
* Minor number is increased when AutoQA adds new features.
* Revision number is increased when AutoQA adds new hotfixes, but no new features.
 
== Pre-requisites ==
 
You must have AutoQA source code checked out with write access (''ssh://'' protocol, requires [https://admin.fedoraproject.org/accounts/group/view/gitautoqa gitautoqa] membership):
 
<pre>git clone ssh://git.fedorahosted.org/git/autoqa.git
cd autoqa
</pre>
 
== Git branching ==
 
All the changes must be done in a correct git branch. The description below documents the process.
 
=== Major or minor releases ===
 
AutoQA uses ''release branches'' for every major or minor release. That means before tagging a new release a new branch is always created. If we want to create new 0.X.0 minor release:
 
<ol>
<li>Create new release branch: <pre>git checkout -b release-0.X master</pre></li>
<li>[[#Update autoqa.spec|Update the {{filename|autoqa.spec}} file and commit]]</li>
<li>[[#Cherry-pick to master|Cherry-pick the last commit to master]]</li>
<li>Tag new release:<pre>git tag v0.X.0 release-0.X</pre></li>
<li>Push changes to remote repository:<pre>git push --tags origin master release-0.X</pre></li>
</ol>
 
{{admon/tip|Time of branching|It is possible to create ''release-0.X'' branch immediately before tagging ''0.X.0'' release, or it is possible to do it much earlier - then we can use ''master'' for further heavy development and ''release-0.X'' for stabilization of the current features.}}
 
{{admon/note|Major releases|The process for major releases it's the same as described above, just replace ''branch-0.X'' names with ''branch-X.0''.}}
 
=== Revision releases ===
 
All revision releases simply mean committing relevant changesets to the relevant release branch and tagging a new release:
 
<ol>
<li>Switch to correct release branch: <pre>git checkout release-0.X</pre></li>
<li>Commit the hotfixes you have prepared</li>
<li>[[#Update autoqa.spec|Update the {{filename|autoqa.spec}} file and commit]]</li>
<li>Tag new release:<pre>git tag v0.X.Y</pre></li>
<li>Push changes to remote repository:<pre>git push --tags origin release-0.X</pre></li>
</ol>
 
== Intermediary tasks ==
 
=== Update {{filename|autoqa.spec}} ===
Every new release must be mentioned in the rpm {{filename|spec}} file.


# Checkout the ''master'' branch of autoqa <pre>git clone ssh://git.fedorahosted.org/git/autoqa.git && cd autoqa</pre>
# Edit {{filename|autoqa.spec}} by incrementing the <code>Version</code> and updating the <code>%changelog</code>
# Edit {{filename|autoqa.spec}} by incrementing the <code>Version</code> and updating the <code>%changelog</code>
# Locally commit the changes <pre>git commit autoqa.spec</pre>
# Locally commit the changes <pre>git commit autoqa.spec</pre>
# Push your changes to the remote git repository (requires [https://admin.fedoraproject.org/accounts/group/view/gitautoqa gitautoqa] membership) <pre> git push origin master</pre>


== Cherry-pick and tag ==
=== Cherry-pick to master ===
Next, we'll cherry-pick the {{filename|autoqa.spec}} change into the ''stable'' git branch and tag the release.
After you tag the release on the release branch, you will want to cherry-pick the {{filename|autoqa.spec}} change (e.g. tagged with ''release-0.X'' tag) into the master branch.
 
# Change to the ''master'' branch <pre>git checkout master</pre>
# Cherry-pick the updated {{filename|autoqa.spec}} change <pre>git cherry-pick release-0.X</pre>


# Change to the ''stable'' branch <pre>git checkout -b stable origin/stable || git checkout stable</pre>
== Closing tasks ==
# Cherry pick the updated {{filename|autoqa.spec}} change <pre>git cherry-pick origin/master</pre>
# Tag the release <pre>git tag vX.Y.X-1,2,3 stable</pre>
# Push your changes (requires [https://admin.fedoraproject.org/accounts/group/view/gitautoqa gitautoqa] membership) <pre>git push --tags origin stable</pre>


== Upload tarball ==
=== Upload tarball ===
Like many projects, the appropriate method to release a new version is by tarball.  Once you have tagged the release, upload a new tarball using the following commands.
Like many projects, the appropriate method to release a new version is by tarball.  Once you have tagged the release, upload a new tarball using the following commands.


# Change to the ''stable'' branch <pre>git checkout -b stable origin/stable || git checkout stable</pre>
# Check-out the correct tag (e.g. ''v0.X.0'') <pre>git checkout v0.X.0</pre>
# Upload a new release tarball <pre>make upload</pre>
# Upload a new release tarball <pre>make upload</pre>


== Build a source RPM ==
=== Build a source RPM ===
With the tarball uploaded, it's time to package the new release as an RPM.
With the tarball uploaded, it's time to package the new release as an RPM.


# Change to the ''stable'' branch <pre>git checkout -b stable origin/stable || git checkout stable</pre>
# Check-out the correct tag (e.g. ''v0.X.0'') <pre>git checkout v0.X.0</pre>
# Build a source package from the current ''stable'' branch <pre>make srpm</pre>
# Build a source package <pre>make srpm</pre>


== Build for applicable releases ==
=== Build for applicable releases ===
With a source RPM created, it's time to '''build''' updated packages for any existing ''stable'' repositories.  This includes {{FedoraVersion|long|current}}, {{FedoraVersion|long|previous}} and, depending on the time of release, potentially {{FedoraVersion|long|previous2}}.  Traditionally, this step would be handled by running the {{command|koji build --tag dist-f{{FedoraVersionNumber|current}}-updates path/to/src.rpm}} command.  However, since {{package|autoqa}} is not yet packaged and available in Fedora repositories, updates are built locally using {{command|mock}}.
With a source RPM created, it's time to '''build''' updated packages for any existing ''stable'' repositories.  This includes {{FedoraVersion|long|current}}, {{FedoraVersion|long|previous}} and, depending on the time of release, potentially {{FedoraVersion|long|previous2}}.  Traditionally, this step would be handled by running the {{command|koji build --tag dist-f{{FedoraVersionNumber|current}}-updates path/to/src.rpm}} command.  However, since {{package|autoqa}} is not yet packaged and available in Fedora repositories, updates are built locally using {{command|mock}}.


Line 43: Line 91:
}}
}}


== Create updates ==
=== Create updates ===
With packages built, it's time to submit them as updates.  Traditionally, this step would be handled by using the [[Package_update_HOWTO#Working_with_packages_in_the_stable_branches|bodhi update tool]].  However, since {{package|autoqa}} is not yet packaged and available in official Fedora repositories, a [[Fedorapeople_Repos|custom package repository]] is used to deliver updates.
With packages built, it's time to submit them as updates.  Traditionally, this step would be handled by using the [[Package_update_HOWTO#Working_with_packages_in_the_stable_branches|bodhi update tool]].  However, since {{package|autoqa}} is not yet packaged and available in official Fedora repositories, a [[Fedorapeople_Repos|custom package repository]] is used to deliver updates.


<ol>
<ol>
<li> Mirror the autoqa package repository locally <pre>rsync -avz fedorapeople.org:/srv/repos/fedora-qa/autoqa ~/public_html/ ; cd autoqa/</pre>
<li> Mirror the autoqa package repository locally <pre>rsync -avz fedorapeople.org:/srv/repos/fedora-qa/autoqa ~/public_html/ ; cd autoqa/</pre></li>
<li> Add locally built packages to the desired repositories <pre>./move-pkgs.sh path/to/autoqa.git/rpm-build/MOCK/*/*.rpm</pre>
<li> Add locally built packages to the desired repositories <pre>./move-pkgs.sh path/to/autoqa.git/rpm-build/MOCK/*/*.rpm</pre>
{{admon/note|Simulating the ''updates-testing'' repository|For pre-release or testing packages an alternative repository is available to mimic the official ''updates-testing'' Fedora repository.  To submit packages into the ''fedora-autoqa-testing'' repository, add the command-line option <code>-r testing</code>.  A complete example is included below.
{{admon/note|Simulating the ''updates-testing'' repository|For pre-release or testing packages an alternative repository is available to mimic the official ''updates-testing'' Fedora repository.  To submit packages into the ''fedora-autoqa-testing'' repository, add the command-line option <code>-r testing</code>.  A complete example is included below.
<pre>./move-pkgs.sh -r testing path/to/autoqa.git/rpm-build/MOCK/*/*.rpm</pre>
<pre>./move-pkgs.sh -r testing path/to/autoqa.git/rpm-build/MOCK/*/*.rpm</pre>
}}
}}</li>
<li> Update the yum repo metadata <pre>./update-repos.sh</pre>
<li> Update the yum repo metadata <pre>./update-repos.sh</pre></li>
<li> Update remote repository with changes <pre> rsync -avz ~/public_html/autoqa fedorapeople.org:/srv/repos/fedora-qa/</pre>
<li> Update remote repository with changes <pre> rsync -avz ~/public_html/autoqa fedorapeople.org:/srv/repos/fedora-qa/</pre></li>
</ol>
 
== Cleanup tasks ==
 
=== Purging old release branches ===
 
If we are sure we will no longer work on older releases (e.g. before ''0.X''), we can also delete older release branches. If Y < X, then we can delete ''release-0.Y'':
 
<pre>
git tag --contains release-0.Y  # This must output some tag (like v0.Y.3).
                                # It ensures there's a tag at the tip of
                                # the branch and therefore no work is lost.
git branch -D release-0.Y
git push origin :release-0.Y
</pre>
 
 


[[Category:AutoQA]]
[[Category:AutoQA]]

Revision as of 12:51, 11 July 2011

This page describes the process for tagging, building and deploying a new version of autoqa. This page assumes a basic understanding of rpm spec file syntax and commands such as git, mock and yum.

Numbering scheme

Each release has X.Y.Z identification denoting a major, a minor and a revision number:

  • Major number is increased when AutoQA makes incompatible changes in its test API. (Not used currently, since no stable public API has been offered yet.)
  • Minor number is increased when AutoQA adds new features.
  • Revision number is increased when AutoQA adds new hotfixes, but no new features.

Pre-requisites

You must have AutoQA source code checked out with write access (ssh:// protocol, requires gitautoqa membership):

git clone ssh://git.fedorahosted.org/git/autoqa.git
cd autoqa

Git branching

All the changes must be done in a correct git branch. The description below documents the process.

Major or minor releases

AutoQA uses release branches for every major or minor release. That means before tagging a new release a new branch is always created. If we want to create new 0.X.0 minor release:

  1. Create new release branch:
    git checkout -b release-0.X master
  2. Update the autoqa.spec file and commit
  3. Cherry-pick the last commit to master
  4. Tag new release:
    git tag v0.X.0 release-0.X
  5. Push changes to remote repository:
    git push --tags origin master release-0.X
Time of branching
It is possible to create release-0.X branch immediately before tagging 0.X.0 release, or it is possible to do it much earlier - then we can use master for further heavy development and release-0.X for stabilization of the current features.
Major releases
The process for major releases it's the same as described above, just replace branch-0.X names with branch-X.0.

Revision releases

All revision releases simply mean committing relevant changesets to the relevant release branch and tagging a new release:

  1. Switch to correct release branch:
    git checkout release-0.X
  2. Commit the hotfixes you have prepared
  3. Update the autoqa.spec file and commit
  4. Tag new release:
    git tag v0.X.Y
  5. Push changes to remote repository:
    git push --tags origin release-0.X

Intermediary tasks

Update autoqa.spec

Every new release must be mentioned in the rpm spec file.

  1. Edit autoqa.spec by incrementing the Version and updating the %changelog
  2. Locally commit the changes
    git commit autoqa.spec

Cherry-pick to master

After you tag the release on the release branch, you will want to cherry-pick the autoqa.spec change (e.g. tagged with release-0.X tag) into the master branch.

  1. Change to the master branch
    git checkout master
  2. Cherry-pick the updated autoqa.spec change
    git cherry-pick release-0.X

Closing tasks

Upload tarball

Like many projects, the appropriate method to release a new version is by tarball. Once you have tagged the release, upload a new tarball using the following commands.

  1. Check-out the correct tag (e.g. v0.X.0)
    git checkout v0.X.0
  2. Upload a new release tarball
    make upload

Build a source RPM

With the tarball uploaded, it's time to package the new release as an RPM.

  1. Check-out the correct tag (e.g. v0.X.0)
    git checkout v0.X.0
  2. Build a source package
    make srpm

Build for applicable releases

With a source RPM created, it's time to build updated packages for any existing stable repositories. This includes Fedora 41, Fedora 40 and, depending on the time of release, potentially Fedora 39. Traditionally, this step would be handled by running the koji build --tag dist-f41-updates path/to/src.rpm command. However, since autoqa is not yet packaged and available in Fedora repositories, updates are built locally using mock.

Update your mock configuration
You will need to update the mock configuration files in /etc/mock so that the autoqa package repositories are included. Information on autoqa package repositories is available at Install_and_configure_AutoQA.
  1. Build packages using mock for Fedora, specify version using RELEASEVER variable
    make mock-fedora RELEASEVER=41 
  2. Repeat the build procedure for all desired releases
Building for EPEL-5?
Due to changes in the filedigest algorithm, extra care is required when creating packages for EPEL-5. Be sure to set the _source_filedigest_algorithm and _binary_filedigest_algorithm for any packages used when building for EPEL-5. For convenience, a Makefile target is available to create EPEL-5 compatible packages.
make mock-epel RELEASEVER=5

Create updates

With packages built, it's time to submit them as updates. Traditionally, this step would be handled by using the bodhi update tool. However, since autoqa is not yet packaged and available in official Fedora repositories, a custom package repository is used to deliver updates.

  1. Mirror the autoqa package repository locally
    rsync -avz fedorapeople.org:/srv/repos/fedora-qa/autoqa ~/public_html/ ; cd autoqa/
  2. Add locally built packages to the desired repositories
    ./move-pkgs.sh path/to/autoqa.git/rpm-build/MOCK/*/*.rpm
    Simulating the updates-testing repository
    For pre-release or testing packages an alternative repository is available to mimic the official updates-testing Fedora repository. To submit packages into the fedora-autoqa-testing repository, add the command-line option -r testing. A complete example is included below.
    ./move-pkgs.sh -r testing path/to/autoqa.git/rpm-build/MOCK/*/*.rpm
  3. Update the yum repo metadata
    ./update-repos.sh
  4. Update remote repository with changes
     rsync -avz ~/public_html/autoqa fedorapeople.org:/srv/repos/fedora-qa/

Cleanup tasks

Purging old release branches

If we are sure we will no longer work on older releases (e.g. before 0.X), we can also delete older release branches. If Y < X, then we can delete release-0.Y:

git tag --contains release-0.Y  # This must output some tag (like v0.Y.3). 
                                # It ensures there's a tag at the tip of 
                                # the branch and therefore no work is lost.
git branch -D release-0.Y
git push origin :release-0.Y