From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/, buildbot_gentoo_ci/db/
Date: Tue, 13 Apr 2021 14:24:44 +0000 (UTC) [thread overview]
Message-ID: <1618323855.409167eb42b9fbacf05f00a36621e897361138bd.zorry@gentoo> (raw)
commit: 409167eb42b9fbacf05f00a36621e897361138bd
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 13 14:24:15 2021 +0000
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Tue Apr 13 14:24:15 2021 +0000
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=409167eb
Remove project_repository_uuid from db. use int for datetime in db. change mirror_url to url
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
buildbot_gentoo_ci/db/builds.py | 7 +++----
buildbot_gentoo_ci/db/model.py | 32 ++++++++++++--------------------
buildbot_gentoo_ci/db/projects.py | 1 -
buildbot_gentoo_ci/db/repositorys.py | 2 +-
buildbot_gentoo_ci/db/versions.py | 6 ++----
buildbot_gentoo_ci/steps/builders.py | 2 +-
buildbot_gentoo_ci/steps/portage.py | 4 ++--
buildbot_gentoo_ci/steps/repos.py | 2 +-
8 files changed, 22 insertions(+), 34 deletions(-)
diff --git a/buildbot_gentoo_ci/db/builds.py b/buildbot_gentoo_ci/db/builds.py
index 79814b7..2ad67b8 100644
--- a/buildbot_gentoo_ci/db/builds.py
+++ b/buildbot_gentoo_ci/db/builds.py
@@ -23,13 +23,12 @@ import sqlalchemy as sa
from twisted.internet import defer
from buildbot.db import base
-from buildbot.util import epoch2datetime
class BuildsConnectorComponent(base.DBConnectorComponent):
#@defer.inlineCallbacks
def addBuild(self, project_build_data):
- created_at = epoch2datetime(int(self.master.reactor.seconds()))
+ created_at = int(self.master.reactor.seconds())
def thd(conn, no_recurse=False):
tbl = self.db.model.projects_builds
# get the highest current number
@@ -56,7 +55,7 @@ class BuildsConnectorComponent(base.DBConnectorComponent):
@defer.inlineCallbacks
def setSatusBuilds(self, build_id, project_uuid, status):
- updated_at = epoch2datetime(int(self.master.reactor.seconds()))
+ updated_at = int(self.master.reactor.seconds())
def thd(conn, no_recurse=False):
tbl = self.db.model.projects_builds
@@ -69,7 +68,7 @@ class BuildsConnectorComponent(base.DBConnectorComponent):
@defer.inlineCallbacks
def setBuildbotBuildIdBuilds(self, build_id, project_uuid, buildbot_build_id):
- updated_at = epoch2datetime(int(self.master.reactor.seconds()))
+ updated_at = int(self.master.reactor.seconds())
def thd(conn, no_recurse=False):
tbl = self.db.model.projects_builds
diff --git a/buildbot_gentoo_ci/db/model.py b/buildbot_gentoo_ci/db/model.py
index 54c964f..ede5cb7 100644
--- a/buildbot_gentoo_ci/db/model.py
+++ b/buildbot_gentoo_ci/db/model.py
@@ -70,7 +70,7 @@ class Model(base.DBConnectorComponent):
sa.Column('name', sa.String(255), nullable=False),
# description of the repository
sa.Column('description', sa.Text, nullable=True),
- sa.Column('mirror_url', sa.String(255), nullable=True),
+ sa.Column('url', sa.String(255), nullable=True),
sa.Column('type', sa.Enum('gitpuller'), nullable=False, default='gitpuller'),
sa.Column('auto', sa.Boolean, default=False),
sa.Column('enabled', sa.Boolean, default=False),
@@ -98,15 +98,11 @@ class Model(base.DBConnectorComponent):
"projects", metadata,
# unique id per project
sa.Column('uuid', sa.String(36), primary_key=True,
- default=lambda: str(uuid.uuid4()),
- ),
+ default=lambda: str(uuid.uuid4())),
# project's name
sa.Column('name', sa.String(255), nullable=False),
# description of the project
sa.Column('description', sa.Text, nullable=True),
- sa.Column('project_repository_uuid', sa.String(36),
- sa.ForeignKey('repositorys.uuid', ondelete='CASCADE'),
- nullable=False),
sa.Column('profile', sa.String(255), nullable=False),
sa.Column('profile_repository_uuid', sa.String(36),
sa.ForeignKey('repositorys.uuid', ondelete='CASCADE'),
@@ -216,10 +212,10 @@ class Model(base.DBConnectorComponent):
sa.Column('buildbot_build_id', sa.Integer),
sa.Column('status', sa.Enum('failed','completed','in-progress','waiting', 'warning'), nullable=False),
sa.Column('requested', sa.Boolean, default=False),
- sa.Column('created_at', sa.DateTime, nullable=True),
- sa.Column('updated_at', sa.DateTime, nullable=True),
+ sa.Column('created_at', sa.Integer, nullable=True),
+ sa.Column('updated_at', sa.Integer, nullable=True),
sa.Column('deleted', sa.Boolean, default=False),
- sa.Column('deleted_at', sa.DateTime, nullable=True),
+ sa.Column('deleted_at', sa.Integer, nullable=True),
)
projects_pattern = sautils.Table(
@@ -247,16 +243,14 @@ class Model(base.DBConnectorComponent):
categorys = sautils.Table(
"categorys", metadata,
sa.Column('uuid', sa.String(36), primary_key=True,
- default=lambda: str(uuid.uuid4())
- ),
+ default=lambda: str(uuid.uuid4())),
sa.Column('name', sa.String(255), nullable=False),
)
packages = sautils.Table(
"packages", metadata,
sa.Column('uuid', sa.String(36), primary_key=True,
- default=lambda: str(uuid.uuid4()),
- ),
+ default=lambda: str(uuid.uuid4())),
sa.Column('name', sa.String(255), nullable=False),
sa.Column('category_uuid', sa.String(36),
sa.ForeignKey('categorys.uuid', ondelete='CASCADE'),
@@ -265,14 +259,13 @@ class Model(base.DBConnectorComponent):
sa.ForeignKey('repositorys.uuid', ondelete='CASCADE'),
nullable=False),
sa.Column('deleted', sa.Boolean, default=False),
- sa.Column('deleted_at', sa.DateTime, nullable=True),
+ sa.Column('deleted_at', sa.Integer, nullable=True),
)
versions = sautils.Table(
"versions", metadata,
sa.Column('uuid', sa.String(36), primary_key=True,
- default=lambda: str(uuid.uuid4()),
- ),
+ default=lambda: str(uuid.uuid4())),
sa.Column('name', sa.String(255), nullable=False),
sa.Column('package_uuid', sa.String(36),
sa.ForeignKey('packages.uuid', ondelete='CASCADE'),
@@ -280,15 +273,14 @@ class Model(base.DBConnectorComponent):
sa.Column('file_hash', sa.String(255), nullable=False),
sa.Column('commit_id', sa.String(255), nullable=False),
sa.Column('deleted', sa.Boolean, default=False),
- sa.Column('deleted_at', sa.DateTime, nullable=True),
+ sa.Column('deleted_at', sa.Integer, nullable=True),
)
versions_keywords = sautils.Table(
"versions_keywords", metadata,
# unique id per project
sa.Column('uuid', sa.String(36), primary_key=True,
- default=lambda: str(uuid.uuid4()),
- ),
+ default=lambda: str(uuid.uuid4())),
# project's name
sa.Column('keyword_id', sa.Integer,
sa.ForeignKey('keywords.id', ondelete='CASCADE')),
@@ -308,7 +300,7 @@ class Model(base.DBConnectorComponent):
sa.Column("uid", sa.Integer, primary_key=True),
# identifier (nickname) for this user; used for display
- sa.Column("identifier", sa.String(255), nullable=False),
+ sa.Column("email", sa.String(255), nullable=False),
# username portion of user credentials for authentication
sa.Column("bb_username", sa.String(128)),
diff --git a/buildbot_gentoo_ci/db/projects.py b/buildbot_gentoo_ci/db/projects.py
index 2edc14a..2393011 100644
--- a/buildbot_gentoo_ci/db/projects.py
+++ b/buildbot_gentoo_ci/db/projects.py
@@ -194,7 +194,6 @@ class ProjectsConnectorComponent(base.DBConnectorComponent):
uuid=row.uuid,
name=row.name,
description=row.description,
- project_repository_uuid=row.project_repository_uuid,
profile=row.profile,
profile_repository_uuid=row.profile_repository_uuid,
keyword_id=row.keyword_id,
diff --git a/buildbot_gentoo_ci/db/repositorys.py b/buildbot_gentoo_ci/db/repositorys.py
index 8806dd1..8bac1a1 100644
--- a/buildbot_gentoo_ci/db/repositorys.py
+++ b/buildbot_gentoo_ci/db/repositorys.py
@@ -95,7 +95,7 @@ class RepositorysConnectorComponent(base.DBConnectorComponent):
uuid=row.uuid,
name=row.name,
description=row.description,
- mirror_url=row.mirror_url,
+ url=row.url,
auto=row.auto,
enabled=row.enabled,
ebuild=row.ebuild,
diff --git a/buildbot_gentoo_ci/db/versions.py b/buildbot_gentoo_ci/db/versions.py
index 768c1dc..fcc19ee 100644
--- a/buildbot_gentoo_ci/db/versions.py
+++ b/buildbot_gentoo_ci/db/versions.py
@@ -23,8 +23,6 @@ import sqlalchemy as sa
from twisted.internet import defer
from buildbot.db import base
-from buildbot.util import epoch2datetime
-from buildbot.util import datetime2epoch
class VersionsConnectorComponent(base.DBConnectorComponent):
@defer.inlineCallbacks
@@ -76,7 +74,7 @@ class VersionsConnectorComponent(base.DBConnectorComponent):
@defer.inlineCallbacks
def delVersion(self, uuid):
- deleted_at = epoch2datetime(int(self.master.reactor.seconds()))
+ deleted_at = int(self.master.reactor.seconds())
def thd(conn, no_recurse=False):
tbl = self.db.model.versions
@@ -111,5 +109,5 @@ class VersionsConnectorComponent(base.DBConnectorComponent):
file_hash=row.file_hash,
commit_id=row.commit_id,
deleted=row.deleted,
- deleted_at=datetime2epoch(row.deleted_at)
+ deleted_at=row.deleted_at
)
diff --git a/buildbot_gentoo_ci/steps/builders.py b/buildbot_gentoo_ci/steps/builders.py
index e51576f..d9817d8 100644
--- a/buildbot_gentoo_ci/steps/builders.py
+++ b/buildbot_gentoo_ci/steps/builders.py
@@ -300,7 +300,7 @@ class UpdateRepos(BuildStep):
repository_data = yield self.gentooci.db.repositorys.getRepositoryByUuid(project_repository_data['repository_uuid'])
repository_path = yield os.path.join(portage_repos_path, repository_data['name'])
yield self.build.addStepsAfterCurrentStep([
- steps.Git(repourl=repository_data['mirror_url'],
+ steps.Git(repourl=repository_data['url'],
mode='incremental',
submodules=True,
workdir=os.path.join(repository_path, ''))
diff --git a/buildbot_gentoo_ci/steps/portage.py b/buildbot_gentoo_ci/steps/portage.py
index 2308617..c1a4d90 100644
--- a/buildbot_gentoo_ci/steps/portage.py
+++ b/buildbot_gentoo_ci/steps/portage.py
@@ -153,7 +153,7 @@ class SetReposConf(BuildStep):
repository_conf = []
repository_conf.append('[' + repository_data['name'] + ']')
repository_conf.append('location = ' + repository_path)
- repository_conf.append('sync-uri = ' + repository_data['mirror_url'])
+ repository_conf.append('sync-uri = ' + repository_data['url'])
repository_conf.append('sync-type = git')
repository_conf.append('auto-sync = no')
repository_conf_string = separator.join(repository_conf)
@@ -446,7 +446,7 @@ class SetReposConfLocal(BuildStep):
repository_conf = []
repository_conf.append('[' + self.getProperty("repository_data")['name'] + ']')
repository_conf.append('location = ' + repository_path)
- repository_conf.append('sync-uri = ' + self.getProperty("repository_data")['mirror_url'])
+ repository_conf.append('sync-uri = ' + self.getProperty("repository_data")['url'])
repository_conf.append('sync-type = git')
repository_conf.append('auto-sync = no')
yield WriteTextToFile(repos_conf_repository_path, repository_conf)
diff --git a/buildbot_gentoo_ci/steps/repos.py b/buildbot_gentoo_ci/steps/repos.py
index bc06e45..5b6b621 100644
--- a/buildbot_gentoo_ci/steps/repos.py
+++ b/buildbot_gentoo_ci/steps/repos.py
@@ -108,7 +108,7 @@ class CheckRepository(BuildStep):
repo_path = yield pygit2.discover_repository(repository_path)
print(repo_path)
if repo_path is None:
- yield pygit2.clone_repository(repository_data['mirror_url'], repository_path)
+ yield pygit2.clone_repository(repository_data['url'], repository_path)
success = True
else:
repo = yield pygit2.Repository(repo_path)
next reply other threads:[~2021-04-13 14:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 14:24 Magnus Granberg [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-09-25 11:46 [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/, buildbot_gentoo_ci/db/ Magnus Granberg
2021-09-20 23:28 Magnus Granberg
2021-07-09 15:49 Magnus Granberg
2021-04-10 1:03 Magnus Granberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1618323855.409167eb42b9fbacf05f00a36621e897361138bd.zorry@gentoo \
--to=zorry@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox