services/jenkins-scripts.git
10 years agoUpdate the function to match new data structure
ZhuoX Li [Tue, 13 May 2014 09:27:13 +0000 (17:27 +0800)]
Update the function to match new data structure

In previous version, get repo_name by obs_project:obs_repo.
Now, we want get repo_name by obs_project

Change-Id: I3173c53c31d3a16e9299147eeea26e3e9f36fff0

10 years agoUpdate build.xml to match the new repo structure
ZhuoX Li [Fri, 9 May 2014 06:48:25 +0000 (14:48 +0800)]
Update build.xml to match the new repo structure

One example shows as below:

<build version="1.0">
  <id>tizen_20140509.20</id>
  <buildtargets>
    <buildtarget name="ia32-wayland">
      <archs>
        <arch>ia32</arch>
      </archs>
      <repo type="debug">repos/ia32-wayland/debug</repo>
      <repo type="source">repos/ia32-wayland/source</repo>
      <repo type="binary">repos/ia32-wayland/packages</repo>
    </buildtarget>
    <buildtarget name="x86_64-wayland">
      <archs>
        <arch>x86_64</arch>
      </archs>
      <repo type="source">repos/x86_64-wayland/source</repo>
      <repo type="binary">repos/x86_64-wayland/packages</repo>
      <repo type="debug">repos/x86_64-wayland/debug</repo>
    </buildtarget>
  </buildtargets>
</build>

Fixes: #1863

Change-Id: Ie7545a0df1c3011510f50d351639565995edb712

10 years agoFix the bug : reject/request event without complete description
Liu jue [Thu, 8 May 2014 09:14:32 +0000 (17:14 +0800)]
Fix the bug : reject/request event without complete description

When someone reject/request a submit from obs by man made , he/she
may do it without a complete description . So we can not get the
"source project" from description , and it will cause a bug . So we
use "source project" field in event directly .

Change-Id: I9ab929760be146816e849f234433ee3f4621b4c5
Fixes: #1841

10 years agoUpdate debug and packages directory structure
ZhuoX Li [Thu, 8 May 2014 04:33:25 +0000 (12:33 +0800)]
Update debug and packages directory structure

Delete the subdirectory is named for archs in debug directory.
Original .rpm are in subdirectory will be put directly into parent directory.
And use the archs name of OBS replaces the unified archs name 'ia32',
to name the subdirectory in packages directory.

Change-Id: Iec48ec926639dc153bd88d6b8fd53591bd450099

10 years agoFix interface mismatch of extract_image_conf
Lin Yang [Wed, 7 May 2014 07:37:36 +0000 (15:37 +0800)]
Fix interface mismatch of extract_image_conf

The only one parameter of function imagedata.extract_image_conf is image
configuration rpm location, fix incorrect call for it.

Change-Id: I33a56b8718a90dddddbc11f88d70a92fc221ec11
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoSupport get project name of OBS_SRCSRV_REQUEST_*
Lin Yang [Wed, 7 May 2014 07:01:28 +0000 (15:01 +0800)]
Support get project name of OBS_SRCSRV_REQUEST_*

For OBS request event, like OBS_SRCSRV_REQUEST_*, it don't have 'project'
attribute, just 'sourceproject'. So try to get 'sourceproject' if don't
find 'project'.

Change-Id: I93b72ba1d76e26131619272f85a7bc575c2c1222
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoFix image creation issue
Ed Bartosh [Wed, 7 May 2014 16:22:02 +0000 (19:22 +0300)]
Fix image creation issue

job_prerelease_obs strips all lines of .ks file. This breaks patches in
%post section and results in non-functional images.

Example: this stripped patch
patch -p1 -d/ <<'EOF'
diff -urN bad/etc/pam.d/systemd-user good/etc/pam.d/systemd-user
--- bad/etc/pam.d/systemd-user 2014-03-20 10:01:36.657843073 +0100
+++ good/etc/pam.d/systemd-user 2014-03-20 10:06:51.586121696 +0100
@@ -4,5 +4,6 @@

account include system-auth
session include system-auth
+session required pam_systemd.so
auth required pam_deny.so
password required pam_deny.so
EOF

causes this message in the log:
Applying configurations ...
Running scripts ...
patching file etc/pam.d/systemd-user
patch: **** malformed patch at line 6: account include system-auth

and the image doesn't boot to UI because of broken systemd configuration.

Change-Id: Id4e8d391036b67ba2a62a18766e9f369106ea4af
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoPerform Tests on the images built successfully.
Igor Stoppa [Tue, 6 May 2014 10:30:20 +0000 (13:30 +0300)]
Perform Tests on the images built successfully.

Change-Id: I7c621e8f0020688810b42c2e22e92e88f1e8e0aa

10 years agoPylinted job_pre_release_obs
Ed Bartosh [Sun, 4 May 2014 19:55:46 +0000 (22:55 +0300)]
Pylinted job_pre_release_obs

Change-Id: I6f63f0abfd60f1f4b2ac30fa5f3732e6ccf0d4f9
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCatch error of sendmail in job_mail_sender.py
ZhuoX Li [Fri, 4 Apr 2014 09:16:12 +0000 (17:16 +0800)]
Catch error of sendmail in job_mail_sender.py

Catch the error,when happens '5.5.1 Error: no valid recipients'

Change-Id: I8a0cc8d424014c0a86bfdd919438da894ccbdf6f
Fixes: #1404

10 years agoChange the way of dealing with has_images()
ZhuoX Li [Wed, 30 Apr 2014 09:33:54 +0000 (17:33 +0800)]
Change the way of dealing with has_images()

After adding filter, some repos have no ks.
so need to make a distinction between not have image-configuration package,
and not have ks.

Change-Id: I5088c35a2c23f79557f277ccf0e04418c28ae471

10 years agoFix exception for no found git-obs-mapping entity
Yang Lin [Fri, 25 Apr 2014 06:42:19 +0000 (14:42 +0800)]
Fix exception for no found git-obs-mapping entity

When don't find git-obs-mapping entity for one gerrit project, it mean this
project is not need in OBS. This is not an exception for backend scripts. So
just skip this event.

Fixes: #1785

Change-Id: I28935870d0af9118eb4c2dda09129a59462931ee
Signed-off-by: Yang Lin <lin.a.yang@intel.com>
10 years agoPylint for job_imager.py
ZhuoX Li [Tue, 4 Mar 2014 10:43:48 +0000 (18:43 +0800)]
Pylint for job_imager.py

: 31,0: Line too long (83/80)

Change-Id: I9f73d78cb8c4021e1f1953fcf4efe9655bca4ed0

10 years agoReset 'images' meta info for prerelease projects
Ed Bartosh [Sun, 4 May 2014 19:44:09 +0000 (22:44 +0300)]
Reset 'images' meta info for prerelease projects

Reset 'images' meta information when tag is updated (job_submit) or
package build is publised (job_prerelease_obs).

Fixes: #1854

Change-Id: Idf15c2110ac165cbc6f2917280c1da4ccd39c571
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoRepomaker: Fix search criteria for image configuration packages
Ed Bartosh [Sun, 4 May 2014 14:34:55 +0000 (17:34 +0300)]
Repomaker: Fix search criteria for image configuration packages

With current search criteria image-configurations-*.src.rpm was
considered as image configuration binary package, which resulted
in empty list of ks files and images in repomaker structures.
This caused job_prerelease_obs to skip triggering of image creation
as .ks files were not found.

Fixes: #1844

Change-Id: I68c715dde1aa8397952e50ec83fb7d9d2c0293f7
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoChanges path of finding repo packages
ZhuoX Li [Tue, 22 Apr 2014 03:51:48 +0000 (11:51 +0800)]
Changes path of finding repo packages

Use specific path of repo to collect packages for new structure.

Change-Id: Id7ba9f21c698a153abc58b5235a5fff828176828

10 years agoUpdate the repo structure of prerelease
Lin Yang [Mon, 21 Apr 2014 08:02:59 +0000 (16:02 +0800)]
Update the repo structure of prerelease

As the same as regular snapshot, merge all repos of prerelease project into one
single snapshot.

Fixes: #1819

Change-Id: I05a05f3a389aa27fb6ddfcd887ed9f8d7e4f817b
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoMerge all repos into one single snapshot
Lin Yang [Mon, 21 Apr 2014 07:41:22 +0000 (15:41 +0800)]
Merge all repos into one single snapshot

Original every each repo of OBS project will generate one separate snapshot. To
make it be compatible with OBS project structure, merge all repos and related
images into one single snapshot.

Fixes: #1819

Change-Id: Id01e4c333b0615244137f5de50525c0b11865e22
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoSupport multiply repos in repomaker
Lin Yang [Fri, 18 Apr 2014 05:01:39 +0000 (13:01 +0800)]
Support multiply repos in repomaker

Change-Id: Ib3294d690a5aef840c626093b20b22b10aa6a50a
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoMake imagedata save function more generic
Lin Yang [Fri, 18 Apr 2014 04:01:02 +0000 (12:01 +0800)]
Make imagedata save function more generic

When save image config and ks to one directory, it should not limit the
directory to the repo directory. The directory hierarchy, like 'buiddata'
should be handled by high module.

Change-Id: Iabe8b1b4970d24449ee6734f2e9d53393d01b2a8
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoSupport multiply repos in snapshot module
Lin Yang [Mon, 21 Apr 2014 07:05:37 +0000 (15:05 +0800)]
Support multiply repos in snapshot module

Change-Id: I0fb3df6e41fab0545a5e7d8ee1e360fb68f9062f
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoSupoort new repos.yaml format in backenddb
ZhuoX Li [Fri, 18 Apr 2014 10:08:56 +0000 (18:08 +0800)]
Supoort new repos.yaml format in backenddb

To support merge multiply repos into one single snapshot,
add new keyword'Targets' in repos.yaml and remove origin 'Target'.
One example shows asbelow.
- Name: Tizen-generic
  Link: latest
  Release: "tizen"
  TopLevel: /srv/builds/temp/generic
  Project: Tizen:Generic
  ProjectConfig: yes
  SnapshotDir: snapshots/tizen/generic/
  PrereleaseDir: prerelease/tizen/generic/
  Targets:
      - Name: ia32-wayland
        Architectures:
            - ia32
      - Name: ia32-x11
        Architectures:
            - ia32

Fixes: #1820

Change-Id: I81adb4e9333b770e119755168a79400b91cee262

10 years agoChanged version in devel to 0.16
Ed Bartosh [Tue, 15 Apr 2014 07:19:25 +0000 (10:19 +0300)]
Changed version in devel to 0.16

Change-Id: I2f7a9b33d3c6c31c881a135fa39dc47d8bb99de4
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoRemoved branch check
Ed Bartosh [Fri, 11 Apr 2014 09:31:01 +0000 (12:31 +0300)]
Removed branch check

This check confuses and restricts developers and prevents them to submit
changes from tizen branch to tizen_ivi, tizen_generic and similar submit
targets.

Fixes: #1813

Change-Id: I58747824f663f0f85485bb5385eb7680dca15e8c
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoAdd a UploadError class in common/upload_service.py
ZhuoX Li [Fri, 4 Apr 2014 06:24:16 +0000 (14:24 +0800)]
Add a UploadError class in common/upload_service.py

Change-Id: I6d459707b1dff6c27124f2cc929130364709267b

10 years agoAdd a new file for upload_service in common
ZhuoX Li [Thu, 3 Apr 2014 04:47:48 +0000 (12:47 +0800)]
Add a new file for upload_service in common

The server include job_image.py doesn't have gitbuildsys module.
When executes job_image.py, the gitbuildsys module in common/utils.py
is imported and causes 'No module named gitbuildsys.errors'.
In common/utils.py, the only method of upload_service needs gitbuildsys,
so here should put the method in a new file.

Change-Id: Ib4df37a580c47c430caa39d09865cf877cdeedc6

10 years agoCatch buildservice ObsError exception
ZhuoX Li [Wed, 19 Mar 2014 05:50:28 +0000 (13:50 +0800)]
Catch buildservice ObsError exception

When modify the meta conf to unlink raise ObsError exception,
it should be catched.

Fixes: #1726

Change-Id: Icf7602ba813db5a3c0ca9ead4171dd2072b767d5

10 years agoEscape < > to fix xml syntax
Lin Yang [Wed, 26 Mar 2014 07:49:36 +0000 (15:49 +0800)]
Escape < > to fix xml syntax

The prerelease project description contains < and > in submitter email address.
When update project meta in xml meta, it break xml syntax. So escape them when
format the meta.

Fixes: #1754

Change-Id: Ic623959270e2b4ab4ccd207710c4901c86810b70
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoPylint for job_submitobs.py
ZhuoX Li [Mon, 10 Mar 2014 12:21:39 +0000 (20:21 +0800)]
Pylint for job_submitobs.py

C:543,0: Line too long (83/80)
C:294,8:check_sync_pattern: Invalid name "p" (should match [a-z_][a-z0-9_]{2,30}$)

Change-Id: If1ce83ae16bb4bc18b28bfca42b27d2c4616c510

10 years agopylint for common/manifest.py
ZhuoX Li [Thu, 6 Mar 2014 10:22:31 +0000 (18:22 +0800)]
pylint for common/manifest.py

C:  1,0: Missing docstring
F: 22,0: Unable to import 'common.utils'
C: 24,0: Operator not preceded by a space
HEADER="""<?xml version="1.0" encoding="UTF-8"?>
      ^
      """
      C: 29,0: Operator not preceded by a space
      XML_ITEM="""<project name="%s" path="%s" revision="%s"/>\n"""
              ^
              C: 30,0: Operator not preceded by a space
              FOOTER="""</manifest>"""
                    ^
                    C: 35,4:gen_repo_manifest: Operator not followed by a space
                        manifest_head = HEADER %(fetch_url, review_url)
                               ^
                               C: 40,8:gen_repo_manifest: Operator not followed by a space
                                       manifest_body +=XML_ITEM %(prj_name, prj_path, revision)
                          ^^
                          C: 67,4:get_repo_primary_md: Operator not preceded by a space
                              ret_data= {}
                                          ^

Change-Id: I1e6b6255fdfd814518adbb4d08e3a484b0f91d2a

10 years agoPylint for common/utils.py
ZhuoX Li [Thu, 6 Mar 2014 10:10:53 +0000 (18:10 +0800)]
Pylint for common/utils.py

C:196,0: Line too long (83/80)
    C:254,0: Line too long (81/80)
    F: 27,0: Unable to import 'common'
    R: 34,0:Workdir: Too few public methods (0/2)
    C: 53,4:retry.deco_retry: Missing docstring
    C: 54,8:retry.deco_retry.f_retry: Missing docstring
    C: 56,12:retry.deco_retry.f_retry: Invalid name "f" (should match [a-z_][a-z0-9_]{2,30}$)

Change-Id: I24b4185632a1dda96faa3d47e09f3e4724cb5ca0

10 years agoPylint for common/repomaker.py
ZhuoX Li [Wed, 5 Mar 2014 11:52:43 +0000 (19:52 +0800)]
Pylint for common/repomaker.py

C: 82,4:create_dirs: Operator not preceded by a space
    repo_dirs=set([])
                 ^
                 C:102,8:gen_target_dirs: Comma not followed by a space
                         return [os.path.join(repo_dir,["packages", "debug"][is_debug], ftype)]
                                                              ^^

Change-Id: I0d2c1f634f66a8d08f10ad79923ed53e40d62830

10 years agoPylint for job_policycheck.py
ZhuoX Li [Wed, 5 Mar 2014 07:10:03 +0000 (15:10 +0800)]
Pylint for job_policycheck.py

Change-Id: Ic7a8080056f3a936d1de8c9ec43b4a08490c0b67
W:195,23:main: Unused variable 'obs_stg_prj'

10 years agoPylint for job_buildcheck_post.py
ZhuoX Li [Wed, 5 Mar 2014 02:31:34 +0000 (10:31 +0800)]
Pylint for job_buildcheck_post.py

C:100,0: Line too long

Change-Id: If51d9bab7adf6172d254b39fe175a51a6149035b

10 years agoPylint for job_pre_release_obs.py
ZhuoX Li [Tue, 4 Mar 2014 10:44:31 +0000 (18:44 +0800)]
Pylint for job_pre_release_obs.py

 C:115,0: Line too long (81/80)

Change-Id: I4daeeb6d744c9ee72187694ea3853c8bf7b8a56a

10 years agoPylint for job_request.py
ZhuoX Li [Tue, 4 Mar 2014 10:42:56 +0000 (18:42 +0800)]
Pylint for job_request.py

C:202,0: Line too long (82/80)
    C:332,0: Line too long (85/80)
    C:310,8:main: Operator not followed by a space
            print >>sys.stderr, err
                           ^ '

Change-Id: I85b24bc05cdeb25dc7c327c98e038399a56f26d3

10 years agoCatch HTTPError:bad request for submit_req
ZhuoX Li [Mon, 24 Mar 2014 07:55:04 +0000 (15:55 +0800)]
Catch HTTPError:bad request for submit_req

After upload _service, if catches 'Bad Request',
Obs service should enough time to execute.

Change-Id: Ib52d1439ea3969d3f0d2021d4f8f12e86e32f5f9

10 years agoFix bug that package name causes for _service
ZhuoX Li [Fri, 21 Mar 2014 06:35:44 +0000 (14:35 +0800)]
Fix bug that package name causes for _service

 some 'package name' is different from 'spec name'.
When use 'package nam'e from gerrit to create package,
upload _service file is failed.So here use 'spec name'
to create package and upload _service file.

Change-Id: If9a49591edf6c4cf1ff9dc13170a8ee7b7a61ca0

10 years agosubmitobs: Do not submit to projects using prerelease workflow
Ed Bartosh [Fri, 21 Mar 2014 00:32:58 +0000 (02:32 +0200)]
submitobs: Do not submit to projects using prerelease workflow

Submitobs job should skip submission If staging project is set to
'prerelease' in git-obs mapping.

Fixes: #1744

Change-Id: I13b6b761e53337ce5afe3df1b93ef58a5c848c44
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoPylinted
Ed Bartosh [Thu, 20 Mar 2014 23:59:47 +0000 (01:59 +0200)]
Pylinted

Fixed potential crash because of undefined variable 'name'.

Change-Id: I98d15460b846f31630a1f15a386d3105555ad7e6
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agojob_submit: Added commit id and submitter to meta
Ed Bartosh [Thu, 20 Mar 2014 23:53:27 +0000 (01:53 +0200)]
job_submit: Added commit id and submitter to meta

Repa will add commit id and submitter to SR, which is requested by
release engineers in this bug:
https://bugs.tizen.org/jira/browse/TINF-468

Fixes: #1679
Fixes: #TINF-468

Change-Id: I3c6e578eafc5f1c0e7e3194b27511fbc87d5a455
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoDo not notify submitter about revoked SRs
Ed Bartosh [Sat, 15 Mar 2014 13:47:52 +0000 (15:47 +0200)]
Do not notify submitter about revoked SRs

This is a follow-up fix for previously 'fixed' issue. Second try to
disable notifications about 'revoked' SRs from build projects.
Developers are still getting those confusing emails.

Change-Id: I666713f407ebc0e164dc45e3802349cb6d390bbf
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoTrigger post-image-creation job only for pre-release images
Hasan Wan [Tue, 11 Mar 2014 08:28:16 +0000 (10:28 +0200)]
Trigger post-image-creation job only for pre-release images

Fixes: 1678

Change-Id: I1f8c0a208e1d0e00763dc037dd613dd1d8697ebd
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoUse utils.upload_obs_service to replace the method of upload
ZhuoX Li [Mon, 10 Mar 2014 11:00:17 +0000 (19:00 +0800)]
Use utils.upload_obs_service to replace the method of upload

Change-Id: I46e6f04043dca6d1aaf5db5e395e599a0d5722f8

10 years agoChange the method of updating package in job_submitobs.py by using _service
ZhuoX Li [Thu, 27 Feb 2014 10:57:26 +0000 (18:57 +0800)]
Change the method of updating package in job_submitobs.py by using _service

Fixes: #1353

Change-Id: Iee9bbf8906a71a68e829618ee32537731921ad4a

10 years agoPylint for job_update_local_git.py
ZhuoX Li [Tue, 4 Mar 2014 10:40:29 +0000 (18:40 +0800)]
Pylint for job_update_local_git.py

C: 28,0: Line too long (83/80)

Change-Id: I18160bbea39ce5262935f4fb1b08bdcade435228

10 years agoPylint for common/runner.py
Lingchaox Xin [Wed, 5 Mar 2014 03:05:08 +0000 (11:05 +0800)]
Pylint for common/runner.py

C: 87, 0: Exactly one space required after assignment
msg =  'running command: "%s"' % cmd
        ^ (bad-whitespace)
W: 80, 4: Attempting to unpack a non-sequence defined at line 40 (unpacking-non-sequence)

Change-Id: I30de9764b6df5792f6c0fff297b71e7ad09df361

10 years agoPylint for common/mapping.py
Lingchaox Xin [Tue, 4 Mar 2014 09:57:18 +0000 (17:57 +0800)]
Pylint for common/mapping.py

C: 36, 0: No space allowed around keyword argument assignment
    def __get_mapping(self, obj, branch = None):
                                        ^ (bad-whitespace)
C: 66, 0: No space allowed around keyword argument assignment
    def get_submit_mapping(self, project, branch = None):
                                                 ^ (bad-whitespace)
C: 11, 0: Old-style class defined. (old-style-class)

Change-Id: I399144061a1c564344cad68438fbb596b132da6d

10 years agoPylint common/git.py
Lingchaox Xin [Tue, 4 Mar 2014 08:32:16 +0000 (16:32 +0800)]
Pylint common/git.py

Change-Id: I410c4f48a7d75a261b5d2a45685aa57a8cefa2d9

10 years agoCodes pylinted
Lingchaox Xin [Fri, 28 Feb 2014 09:09:25 +0000 (17:09 +0800)]
Codes pylinted

This patch just contains some of them, the rest will be fixed later.

Change-Id: I437f9622ccd812d0c3389d2cfbd970303e5eaa2c

10 years agoUpdated comment about accepted branches
Ed Bartosh [Wed, 26 Feb 2014 13:09:25 +0000 (15:09 +0200)]
Updated comment about accepted branches

Change-Id: I56cea82d3c47724b6ed115e460a10eb1e597c25a
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed naming of accepted branches
Ed Bartosh [Tue, 25 Feb 2014 11:25:30 +0000 (13:25 +0200)]
Fixed naming of accepted branches

Name of accepted branches were made by replacing ':' to '/' in OBS
project name. That caused conflict between branches for subprojects and
main project, e.g. Tizen:IVI and Tizen:IVI:Genivi. For this pair of
projects accepted branches were named as accepted/tizen/ivi and
accepted/tizen/ivi/genivi. This naming approach creates a conflict as
.git/refs/accepted/tizen/ivi can't be directory (for
accepted/tizen/ivi/genivi) and file (for accepted/tizen/ivi) branches at
the same time.

This issue caused failures on backend to update accepted branches.

Fixed by using '_' instead of '/' in branch names, so above 2 example
branches are named as accepted/tizen_ivi and accepted/tizen_ivi_genivi
now and do not conflict with each other.

Fixes: #1435

Change-Id: I3f253f0d438bf9b455a4fc24de151eefa1903ae5
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoRemove duplicate function call for SR revoke event
Lin Yang [Mon, 24 Feb 2014 03:48:04 +0000 (11:48 +0800)]
Remove duplicate function call for SR revoke event

Change-Id: Ie4898a1f0abc62830e344c57851c0b998954b309
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoFixed bug in cleanup job
Ed Bartosh [Thu, 13 Feb 2014 11:57:10 +0000 (13:57 +0200)]
Fixed bug in cleanup job

Cleanup job now takes project name either from 'project' or 'sourceproject'
field of the event structure, passed from OBS.

Previously it was taking project name only from 'project' field, which is set
for OBS_REPO_PUBLISHED event and is not set for SR_ACCEPTED event.
This was the reason for not removing prerelease projects when SR is accepted.

Fixes: #1649

Change-Id: Ie9d37f0dbba7e9d92a436e755ec0a32d636f7d3c
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoRemoving unused imports from common/prerelease.py
Alexander Kanevskiy [Sat, 14 Dec 2013 21:34:04 +0000 (23:34 +0200)]
Removing unused imports from common/prerelease.py

Change-Id: I1a5bfe5b390d0ee01bebb3e155565d2064b3d39a

10 years agoRemove prerelease project when SR is accepted
Ed Bartosh [Sat, 15 Feb 2014 16:09:58 +0000 (18:09 +0200)]
Remove prerelease project when SR is accepted

Prerelease projects should be removed from OBS when their SRs are
accepted as they're not needed anymore.

Fixes: #1649

Change-Id: I7563e19ac2c4be21b1530d110ff771fd996ba7cc
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed crash in job_requests
Ed Bartosh [Sat, 15 Feb 2014 15:34:53 +0000 (17:34 +0200)]
Fixed crash in job_requests

job_requests code assumes that GIT_AUTHOR_EMAIL is set and crashes when
SR is created by repa:

info sending mail for OBS_SRCSRV_REQUEST_ACCEPTED obs_request_accept
Traceback (most recent call last):
  File "/var/lib/jenkins/jenkins-scripts/job_request.py", line 342,
    sys.exit(main())
  File "/var/lib/jenkins/jenkins-scripts/job_request.py", line 307, in
    notify_submiter(event_fields, data)
  File "/var/lib/jenkins/jenkins-scripts/job_request.py", line 281, in
    os.getenv('EMAIL_TEMPLATES_DIR'))
  File "/var/lib/jenkins/jenkins-scripts/requests/mailer.py", line 267,
    if isinstance(request_data[_to], list):
KeyError: 'GIT_AUTHOR_EMAIL'

The reason for this is that repa's SRs don't have 'Submitter' field,
which is used to set GIT_AUTHOR_EMAIL. However, it's not mandatory as
even current code gets submitter name and email from git.

This change sets GIT_AUTHOR_EMAIL using information from git.

Fixes: #1653

Change-Id: I4349687d04717e11f0cbe42819a75356fd029a61
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoSkipped notification about SR creation for prerelease projects
Ed Bartosh [Sat, 15 Feb 2014 15:10:42 +0000 (17:10 +0200)]
Skipped notification about SR creation for prerelease projects

As repa creates SRs and immediately accepts/rejects them there is no
need to notify submitter about SR creation as he/she will be anyway
notified about SR acceptance or rejection.

Fixes: #1655

Change-Id: Ice23ca4338c1b5de0e64117abec10b4ed5d167b0
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoDo not notify submitter when SR is revoked
Ed Bartosh [Sat, 15 Feb 2014 13:02:21 +0000 (15:02 +0200)]
Do not notify submitter when SR is revoked

This is done to stop confusing developers by sending them notifications
about revoked SRs. SRs are revoked because submissions are accepted by
repa tool.

Fixes: #1652

Change-Id: I2663899ef9a90538c89fc4f485ef34e6cacd2203
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoDelete package when SR is revoked
Ed Bartosh [Sat, 15 Feb 2014 12:53:54 +0000 (14:53 +0200)]
Delete package when SR is revoked

OBS event OBS_SRCSRV_REQUEST_REVOKED was not processed correctly in
job_requests and projects were not deleted.

Fixes: #1654

Change-Id: I92e47978e20c7e111af332e7a082037f3d8eb140
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFix the prerelease repo inconsistent with new repo structure issues
Hasan Wan [Tue, 18 Feb 2014 03:00:50 +0000 (05:00 +0200)]
Fix the prerelease repo inconsistent with new repo structure issues

Fixes: #1658

Change-Id: If66d81ec1ceeebd4438c20c9251be5fc73d56892
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agouse modifyrepo_c to modify repo
Hasan Wan [Tue, 18 Feb 2014 02:53:11 +0000 (04:53 +0200)]
use modifyrepo_c to modify repo

keep the groups.xml and patterns.xml in repo to avoid the patterns
not found issues

Fixes: #1657

Change-Id: Ia5701206386ae056ba2a735048336b22dae24aab
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoLimit python-requests version 2.0.1+ to have a good no_proxy support
Lingchaox Xin [Tue, 11 Feb 2014 09:10:46 +0000 (17:10 +0800)]
Limit python-requests version 2.0.1+ to have a good no_proxy support

Since python-requests in our Service Repo is 1.1.0 version, we need
upgrade it to a higher version(now the latest is 2.2.1).

Change-Id: I1bfcf1c5de2b0c7998d3615bb5b7fc658b88bd97

10 years agoFix `IOError: [Errno 2] No such file or directory` when sync diff
Lingchaox Xin [Mon, 10 Feb 2014 09:23:23 +0000 (17:23 +0800)]
Fix `IOError: [Errno 2] No such file or directory` when sync diff

Change-Id: I1c128842679e7c6f220103dc929055fb8210a8bc

10 years agoFix pylint warning: redefining build-in function 'map'
Alexander Kanevskiy [Sat, 14 Dec 2013 21:32:05 +0000 (23:32 +0200)]
Fix pylint warning: redefining build-in function 'map'

W: 44, 8: Redefining built-in 'map' (redefined-builtin)

Change-Id: Ia657e719a565c3924c8505c3e9be910ea1e039c9

10 years agoAdded GPLv2 COPYING file and correct the License in spec
JF Ding [Sat, 8 Feb 2014 09:04:16 +0000 (17:04 +0800)]
Added GPLv2 COPYING file and correct the License in spec

Because we have passed the company's open-sourcing approval long before,
we need to align the license description in spec file accordingly.

And added the license file for GPLv2 by the way, the source of copy:

  http://www.gnu.org/licenses/gpl-2.0.txt

Change-Id: Ibb49999d8fca9f5eeb234fc5372f016d387e0fbc
Signed-off-by: JF Ding <jian-feng.ding@intel.com>
10 years agojob_policycheck: Check if packaging directory exists
Ed Bartosh [Fri, 24 Jan 2014 15:30:55 +0000 (17:30 +0200)]
job_policycheck: Check if packaging directory exists

Check if packaging/ directory exists before running gbs export.
Otherwize it will crash this way:

running command: "git clone
ssh://tizenrobot@review.tizen.org:29418/sdk/ide/webapp-eplugin
--reference /var/lib/jenkins/git/sdk/ide/webapp-eplugin.git
/var/lib/jenkins/jobs/policy-check/workspace/_wBiPn/sdk/ide/webapp-eplugin
", with output::
+-------------- | Cloning into
/var/lib/jenkins/jobs/policy-check/workspace/_wBiPn/sdk/ide/webapp-eplugin...
+--------------
gbp:debug: git fetch --quiet --tags origin refs/changes/29/13329/2
gbp:debug: git checkout --quiet FETCH_HEAD
packaging dir is
/var/lib/jenkins/jobs/policy-check/workspace/_wBiPn/sdk/ide/webapp-eplugin/packaging
gbp:debug: git checkout --quiet FETCH_HEAD
Traceback (most recent call last):
File "jenkins-scripts/job_policycheck.py", line 196, in <module>
sys.exit(main())
File "jenkins-scripts/job_policycheck.py", line 172, in main
if not export(prjdir, packagingdir, mygit, events, mygerrit):
File "jenkins-scripts/job_policycheck.py", line 62, in export
tempd = tempfile.mkdtemp(dir=os.path.join(prjdir, packagingdir))
File "/usr/lib64/python2.7/tempfile.py", line 318, in mkdtemp
_os.mkdir(file, 0700)
OSError: [Errno 2] No such file or directory:
'/var/lib/jenkins/jobs/policy-check/workspace/_wBiPn/sdk/ide/webapp-eplugin/packaging/tmpG92RZU'

Fixes: #1506

Change-Id: Ib73b64724ad60358328243f346a04331429327ef
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agocommon/mapping.py: Improve xml parsing error handling
Ed Bartosh [Fri, 24 Jan 2014 12:34:00 +0000 (14:34 +0200)]
common/mapping.py: Improve xml parsing error handling

Added local exception MappingError and properly process it in
policycheck job.

Fixes: #1541

Change-Id: I3e4ab8a7ec150933876ecb4f02461406833b8e6d
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoAdd index.html in templates in spec
Lingchaox Xin [Fri, 24 Jan 2014 07:43:52 +0000 (15:43 +0800)]
Add index.html in templates in spec

This will fix `jinja2.exceptions.TemplateNotFound: index.html` error.

Change-Id: Ic73be70bedb67372c7cd414f123375894b4c90b5

10 years agoFix IndexError when repo info has no element
Lingchaox Xin [Thu, 23 Jan 2014 09:56:41 +0000 (17:56 +0800)]
Fix IndexError when repo info has no element

Change-Id: Id2764928ab6ca99c88f5ad330e1bcf1c023159c8

10 years agoAdapt for new interface in python-snapdiff
Lingchaox Xin [Thu, 23 Jan 2014 09:43:10 +0000 (17:43 +0800)]
Adapt for new interface in python-snapdiff

Change-Id: I46725b4ee8caeb1de0488c32091ed11a0af1e36a

10 years agoSplit trigger_image_creation function into two parts
Lingchaox Xin [Thu, 9 Jan 2014 07:55:38 +0000 (15:55 +0800)]
Split trigger_image_creation function into two parts

From now on, triggering jobs and preparing trigger data are
independent, and it is more readable.

Change-Id: Ie2ab0a9cec388751b6805f2ec6cdbaf63ae2b5f7

10 years agouse the new repo structure
Hasan Wan [Fri, 13 Dec 2013 07:30:19 +0000 (07:30 +0000)]
use the new repo structure

Change-Id: Ideebe8d0bcf0deeaa6988fd5e921f4c031bf5183
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agocreate the latest repo link
Hasan Wan [Mon, 6 Jan 2014 03:11:53 +0000 (03:11 +0000)]
create the latest repo link

Change-Id: I6ab84a1c80a1881e243b096c964bad0c6cd80929
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoremove unused function
Hasan Wan [Mon, 6 Jan 2014 02:57:00 +0000 (02:57 +0000)]
remove unused function

Change-Id: I99a3c65d00163b78df2885d1850c6f4e94b99c2d
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoIntegrate snapdiff into jenkins-scripts
Lingchaox Xin [Tue, 24 Dec 2013 10:02:40 +0000 (18:02 +0800)]
Integrate snapdiff into jenkins-scripts

Change-Id: Idaf2791be10ab1d0e72536200c11c065692024f2

10 years agofix a potenntial bug about find package-groups package
Hasan Wan [Fri, 13 Dec 2013 07:34:46 +0000 (07:34 +0000)]
fix a potenntial bug about find package-groups package

Change-Id: Id9857210eb1561fbf8a4ce77ddd27dcd1b1f274f
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoFix format string operation
Alexander Kanevskiy [Sat, 14 Dec 2013 21:15:11 +0000 (23:15 +0200)]
Fix format string operation

Change-Id: I9e4ee98e51e22d3e82e6147af344d03b4529caf1

10 years agoAdd unitest testcase for gbs interface
ZhuoX Li [Fri, 13 Dec 2013 09:34:31 +0000 (17:34 +0800)]
Add unitest testcase for gbs interface

Change-Id: Ia8eb7d35ac9c7478433acb5a8052c2a5f840faa6

10 years agoAdd unitest testcase for gbp interface
ZhuoX Li [Fri, 13 Dec 2013 09:33:45 +0000 (17:33 +0800)]
Add unitest testcase for gbp interface

Change-Id: I362d3e0563d56b5dfc7df4fd8a2285b9bb243772

10 years agoCombine all repos build result into one comments
Lin Yang [Tue, 10 Dec 2013 08:55:40 +0000 (16:55 +0800)]
Combine all repos build result into one comments

Change-Id: I565f3856072776f20505411e83ec21eafc848104
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoAdd profile info into accept tag name
Lin Yang [Tue, 10 Dec 2013 12:00:33 +0000 (20:00 +0800)]
Add profile info into accept tag name

Change accept tag name format to accept/{OBS_PRJ_NAME}/{DATE.TIME} to insert
profile info.

Fixes: #1511

Change-Id: I1d1e5087e3966e4ec52b804c631037c7cfef8093
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agopolicycheck: Check if specs found in packaging/ directory
Ed Bartosh [Sun, 8 Dec 2013 11:37:35 +0000 (13:37 +0200)]
policycheck: Check if specs found in packaging/ directory

If there is no spec files in packaging/ directory job should fail and
send message back to gerrit informing submitter about the issue.

Change-Id: Ib6a129fe94fc9e011fd9b33be31f4083b6d73bc2
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agopolicycheck: fail the job if gbs export fails
Ed Bartosh [Sun, 8 Dec 2013 11:41:46 +0000 (13:41 +0200)]
policycheck: fail the job if gbs export fails

If gbs export fails job should fail as this is definitely policy issue.
Ignoring this doesn't make sense.

Change-Id: Ibf377af948e229d6c01f5cb3bda7bdeba83ea07e
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agopolicycheck: Check if packaging/ directory exist
Ed Bartosh [Sun, 8 Dec 2013 11:30:23 +0000 (13:30 +0200)]
policycheck: Check if packaging/ directory exist

if there is no packaging/ directory in the project policycheck should
fail and send message back to Gerrit.

Currently if project doesn't have packaging directory job produces
non-informative traceback:
Traceback (most recent call last):
  File "jenkins-scripts/job_policycheck.py", line 196, in <module>
    sys.exit(main())
  File "jenkins-scripts/job_policycheck.py", line 172, in main
    if not export(prjdir, packagingdir, mygit, events, mygerrit):
  File "jenkins-scripts/job_policycheck.py", line 62, in export
    tempd = tempfile.mkdtemp(dir=os.path.join(prjdir, packagingdir))
  File "/usr/lib64/python2.7/tempfile.py", line 318, in mkdtemp
    _os.mkdir(file, 0700)

and doesn't report anything back to submitter.

Fixes: #1526

Change-Id: Ic98c26e04c45ff22eeb9136acfe006159d9eff5c
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCatch backenddb EntityError exception
Ed Bartosh [Sun, 8 Dec 2013 13:06:11 +0000 (15:06 +0200)]
Catch backenddb EntityError exception

When there is no map for some OBS project backenddb API raises
EntityError exception. It should be catched.

Fixes: #1528

Change-Id: I4c7fa8c5562c4d01a5d9b67e9a4a5d1d38e4b082
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCheck if key is in mapping to avoid KeyError
Ed Bartosh [Sun, 8 Dec 2013 10:15:03 +0000 (12:15 +0200)]
Check if key is in mapping to avoid KeyError

This change should fix KeyError traceback in parsing description. In
current code everything with ':' is considered as key:value, which is
incorrect assumption as ':' is a very common symbol.

Fixes: #1524

Change-Id: I29deb4e410ba820535e09d8c4808894296c40cda
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agojob_pre_release_gerrit: Check if prerelease enabled for OBS project
Ed Bartosh [Mon, 9 Dec 2013 18:17:08 +0000 (20:17 +0200)]
job_pre_release_gerrit: Check if prerelease enabled for OBS project

To avoid triggering workflow for all projects prerelease_enabled
function is implemented and used in job_pre_release_gerrit to filter out
unrelated projects.

Fixes: #1531

Change-Id: I65f3cd98bedacf61e7dae769b94f4c7091c52d4a
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed linking and unlinking repositories
Ed Bartosh [Mon, 9 Dec 2013 09:32:41 +0000 (11:32 +0200)]
Fixed linking and unlinking repositories

Linking and unlinking was changing only first repository in the project.
The rest repos were left unchanged.

Fixes: #1530

Change-Id: Ia40fc6249f244644375a1b71f2c9a8ddfccc2067
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCheck return code of sync function
Ed Bartosh [Wed, 4 Dec 2013 12:26:29 +0000 (14:26 +0200)]
Check return code of sync function

When sync filed job_imager should also fail.

Fixes: #1513

Change-Id: I261b6c1844f1c2aa2e19e8b968f08a39d4b93e96
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agofix the releaesid key name mistake when update value
Hasan Wan [Wed, 4 Dec 2013 06:44:22 +0000 (08:44 +0200)]
fix the releaesid key name mistake when update value

Change-Id: I08168e89393b7d49e4b20bd49fe4931257d61119
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoFix a typo when get exception
Hasan Wan [Wed, 4 Dec 2013 06:42:22 +0000 (08:42 +0200)]
Fix a typo when get exception

Change-Id: I9761ec87c71684b0c060f75d4e906bff8388bdca
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoenable createrepo_c for repomaker
Hasan Wan [Wed, 4 Dec 2013 06:15:40 +0000 (08:15 +0200)]
enable createrepo_c for repomaker

Change-Id: I53166ed7cace598b7b7e569f9c9fa425d148560f
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoCode cleanup of job_pre_release_obs
Ed Bartosh [Mon, 2 Dec 2013 16:39:22 +0000 (18:39 +0200)]
Code cleanup of job_pre_release_obs

Pylinted + code cleanup.

Change-Id: Ifaa2adb1cd57d5dcaeee5f0abf7e4871266960d2
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCleanup prerelese repos from all snapshots
Ed Bartosh [Sun, 1 Dec 2013 21:17:07 +0000 (23:17 +0200)]
Cleanup prerelese repos from all snapshots

When cleaning up prerelease repos we should consider all snapshots, not
just the latest one.

Change-Id: I85b2d1dfedeb979eaf135ca5f4416ef54c3fbb93
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoReimplemented logic of finding published repos
Ed Bartosh [Sun, 1 Dec 2013 20:16:56 +0000 (22:16 +0200)]
Reimplemented logic of finding published repos

Current logic assumes that all repos of one OBS projects have the same
snapshot id, which is not always true. First of all due to the bug in
boss-repomaker they're always different. Second, for one OBS project
some repos can be published, but some can't because of package build
failures, so snapshot ids can be different for different repos in the
same project and they has to be found and cleaned up.

As it's impossible to find repo only by OBS project name more
sophisticated logic should be used:
 - Find all keys, starting from OBS prject name
 - Part after colon may be repo name
 - Repo name should not contain colon as some projects may have the same
   prefix, e.g. Tizen:IVI and Tizen:IVI:Release

Change-Id: I018105dc52244d8530b26daa5a4b47bf6cc6ea1a
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoUsed repo name as a part of release key
Ed Bartosh [Mon, 2 Dec 2013 16:11:11 +0000 (18:11 +0200)]
Used repo name as a part of release key

PartOf and Release keys in repos.yaml are not uniq. Using them as a
uniq identifier leads to breakage of workflow as they're continuously
rewritten by repomaker for every snapshot for the repos with the
same PartOf and Release keys in repos.yaml

This change uses repo name instead of PartOf and Release. Name is
uniq in repos.yaml, so this should hopefully fix the issue.

Note, that this change requires repomaker to store release ids using
repo name. This is done in this change:
    https://otctools.jf.intel.com/review/#/c/8189/

Change-Id: I63e033bff640ec2ae93e1d522dce55758aff2acd
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoPylinted job_pre_release_obs.py
Ed Bartosh [Mon, 2 Dec 2013 16:06:38 +0000 (18:06 +0200)]
Pylinted job_pre_release_obs.py

Change-Id: I65f7ff443ecfbb941f91cd8bf2e92ada2d6f82fc
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoRefined warning message
Ed Bartosh [Sat, 30 Nov 2013 15:34:37 +0000 (17:34 +0200)]
Refined warning message

This is quite important message. Let's make it a bit more clear.

Change-Id: I3653a702511d06e1e93e7697cab5ea3e7cfd85f4
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoUsed OBS repo to find repo name from repos.yaml
Ed Bartosh [Mon, 2 Dec 2013 15:57:39 +0000 (17:57 +0200)]
Used OBS repo to find repo name from repos.yaml

This is an adaptation of job_pre_release_obs and job_create_snapshot to
the change in the key format for obs -> repo mappings. Now OBS repository
is also used to find repo name. This change passes OBS repository to
Snapshot class to find repo name properly.

Change-Id: I30adf0c8f3efceaabeec77a468613cacf2ec1e23
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>