#5947: fedora-release[-server] patch: require rolekit
by Fedora Release Engineering
#5947: fedora-release[-server] patch: require rolekit
-----------------------------+------------------------
Reporter: mitr | Owner: rel-eng@…
Type: task | Status: new
Milestone: Fedora 21 Alpha | Component: other
Keywords: | Blocked By:
Blocking: |
-----------------------------+------------------------
now that we finally have the first release of rolekit packaged, please
apply the attached patch both to f21 and master.
Thanks!
--
Ticket URL: <https://fedorahosted.org/rel-eng/ticket/5947>
Fedora Release Engineering <http://fedorahosted.org/rel-eng>
Release Engineering for the Fedora Project
9 years, 8 months
[PATCH] Clone anonymously, authenticate for pushing
by Mathieu Bridon
A common source of (minor) frustration for non-packager-savvy people
trying to clone package trees is:
$ fedpkg clone foobar
Cloning into 'foobar'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Could not execute clone: Command '['git', 'clone', 'ssh://you@pkgs.fedoraproject.org/foobar']' returned non-zero exit status 128
ERROR:rpkg:Could not execute clone: Command '['git', 'clone', 'ssh://you@pkgs.fedoraproject.org/foobar']' returned non-zero exit status 128
This is confusing for newcomers (it is not obvious they should have used
the --anonymous/-a option), and it is unneeded: authentication is only
really needed for pushing.
This change makes the --anonymous/-a options completely unnecessary:
- clones are now always done anonymously
- pushes now always require authentication
Using the options now prints a warning that they are unneeded, but keeps
them to avoid breaking existing scripts. The API parameters are also
kept to preserve compatibility with pyrpkg-based tools, but they are now
completely unused.
---
src/pyrpkg/__init__.py | 53 ++++++++++++++++++++++++++++++--------------------
src/pyrpkg/cli.py | 15 +++++++++-----
2 files changed, 42 insertions(+), 26 deletions(-)
diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py
index 425ba5f..8437c26 100644
--- a/src/pyrpkg/__init__.py
+++ b/src/pyrpkg/__init__.py
@@ -1014,7 +1014,7 @@ class Commands(object):
self._run_command(cmd, cwd=self.path)
return
- def clone(self, module, path=None, branch=None, bare_dir=None, anon=False):
+ def clone(self, module, path=None, branch=None, bare_dir=None, anon=None):
"""Clone a repo, optionally check out a specific branch.
module is the name of the module to clone
@@ -1026,19 +1026,22 @@ class Commands(object):
bare_dir is the name of a directory to make a bare clone to, if this is a
bare clone. None otherwise.
- anon is whether or not to clone anonymously
+ anon is now unused, but kept for compatibility with older pyrpkg-based
+ tools.
Logs the output and returns nothing.
"""
+ if anon is not None:
+ self.log.warning("The `anon` argument is now obsolete and "
+ "unneeded")
+
if not path:
path = self.path
# construct the git url
- if anon:
- giturl = self.anongiturl % {'module': module}
- else:
- giturl = self.gitbaseurl % {'user': self.user, 'module': module}
+ anon_giturl = self.anongiturl % {'module': module}
+ authed_giturl = self.gitbaseurl % {'user': self.user, 'module': module}
# Create the command
cmd = ['git', 'clone']
@@ -1049,14 +1052,14 @@ class Commands(object):
raise rpkgError('Cannot combine bare cloning with a branch')
elif branch:
# For now we have to use switch branch
- self.log.debug('Checking out a specific branch %s' % giturl)
- cmd.extend(['-b', branch, giturl])
+ self.log.debug('Checking out a specific branch %s' % anon_giturl)
+ cmd.extend(['-b', branch, anon_giturl])
elif bare_dir:
- self.log.debug('Cloning %s bare' % giturl)
- cmd.extend(['--bare', giturl, bare_dir])
+ self.log.debug('Cloning %s bare' % anon_giturl)
+ cmd.extend(['--bare', anon_giturl, bare_dir])
else:
- self.log.debug('Cloning %s' % giturl)
- cmd.extend([giturl])
+ self.log.debug('Cloning %s' % anon_giturl)
+ cmd.extend([anon_giturl])
if not bare_dir:
# --bare and --origin are incompatible
@@ -1064,27 +1067,33 @@ class Commands(object):
self._run_command(cmd, cwd=path)
+ repo = git.Repo(os.path.join(path, module))
+ repo.remotes["origin"].config_writer.set_value("pushurl", authed_giturl)
+
return
- def clone_with_dirs(self, module, anon=False):
+ def clone_with_dirs(self, module, anon=None):
"""Clone a repo old style with subdirs for each branch.
module is the name of the module to clone
- gitargs is an option list of arguments to git clone
+ anon is now unused, but kept for compatibility with older pyrpkg-based
+ tools.
"""
+ if anon is not None:
+ self.log.warning("The `anon` argument is now obsolete and "
+ "unneeded")
+
# Get the full path of, and git object for, our directory of branches
top_path = os.path.join(self.path, module)
top_git = git.Git(top_path)
repo_path = os.path.join(top_path, 'rpkg.git')
- # construct the git url
- if anon:
- giturl = self.anongiturl % {'module': module}
- else:
- giturl = self.gitbaseurl % {'user': self.user, 'module': module}
+ # construct the git urls
+ anon_giturl = self.anongiturl % {'module': module}
+ authed_giturl = self.gitbaseurl % {'user': self.user, 'module': module}
# Create our new top directory
try:
@@ -1095,7 +1104,7 @@ class Commands(object):
# Create a bare clone first. This gives us a good list of branches
try:
- self.clone(module, top_path, bare_dir=repo_path, anon=anon)
+ self.clone(module, top_path, bare_dir=repo_path)
except Exception, e:
# Clean out our directory
shutil.rmtree(top_path)
@@ -1117,7 +1126,9 @@ class Commands(object):
branch_path = os.path.join(top_path, branch)
branch_git = git.Git(branch_path)
branch_git.config("--replace-all",
- "remote.%s.url" % self.branch_remote, giturl)
+ "remote.%s.url" % self.branch_remote, anon_giturl)
+ branch_git.config("--replace-all",
+ "remote.%s.pushurl" % self.branch_remote, authed_giturl)
except (git.GitCommandError, OSError), e:
raise rpkgError('Could not locally clone %s from %s: %s' %
(branch, repo_path, e))
diff --git a/src/pyrpkg/cli.py b/src/pyrpkg/cli.py
index 1ed8862..709d183 100755
--- a/src/pyrpkg/cli.py
+++ b/src/pyrpkg/cli.py
@@ -347,7 +347,8 @@ defined, packages will be built sequentially.""" %
# allow to clone without needing a account on the scm server
clone_parser.add_argument('--anonymous', '-a',
action = 'store_true',
- help = 'Check out a module anonymously')
+ help = 'Obsolete, kept for compatibility '
+ 'only')
# store the module to be cloned
clone_parser.add_argument('module', nargs = 1,
help = 'Name of the module to clone')
@@ -978,11 +979,9 @@ defined, packages will be built sequentially.""" %
def clone(self):
if self.args.branches:
- self.cmd.clone_with_dirs(self.args.module[0],
- anon=self.args.anonymous)
+ self.cmd.clone_with_dirs(self.args.module[0])
else:
- self.cmd.clone(self.args.module[0], branch=self.args.branch,
- anon=self.args.anonymous)
+ self.cmd.clone(self.args.module[0], branch=self.args.branch)
def commit(self):
if self.args.clog:
@@ -1341,6 +1340,12 @@ Tasks still running. You can continue to watch with the '%s watch-task' command.
# Parse the args
self.args = self.parser.parse_args()
+
+ if "anonymous" in self.args and self.args.anonymous:
+ # Logging is not setup yet
+ sys.stderr.write('WARNING: The --anonymous/-a option is now '
+ 'obsolete and unneeded\n')
+
if self.args.user:
self.user = self.args.user
else:
--
1.9.3
9 years, 8 months
[PATCH] De-hardcode 'origin' as the remote name
by Mathieu Bridon
By default, Git remotes are named 'origin', but some pyrpkg-based tools
might be used to interact with several remotes for the same package
module.
This change allows sites to define how remotes should be called by
simply overriding the Commands.remote attribute.
That attribute is set to "origin" though, to not break existing clones.
The rpkg bash completion resource had to be modified accordingly. Since
the fedpkg one already handles this properly, a simple copy-paste of
that specific line was enough.
---
This is important for us at $dayjob.
We have this rpkg-based tool called nbpkg, which we use to interact with
our packaging infrastructure, similar to fedpkg:
https://github.com/network-box/nbpkg
But as I'm also a Fedora packager, I like to be able to interact with
both our internal infrastructure, and the Fedora one, in the same Git
clone, as it allows me to easily flow changes in both directions.
This workflow requires having different names for each remote though,
they can't just be all called 'origin'. This patch makes this possible.
I can imagine a similar use case for RHEL packagers, which could
probably want to interact with both the Fedora and RHEL packaging
infrastructures in the same Git clone, flowing changes both ways.
I know RPMFusion would be interested as well (I added Nicolas as CC).
src/pyrpkg/__init__.py | 21 ++++++++++++++-------
src/rpkg.bash | 3 +--
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py
index c5b4ae4..89a84a2 100644
--- a/src/pyrpkg/__init__.py
+++ b/src/pyrpkg/__init__.py
@@ -135,6 +135,9 @@ class Commands(object):
self._ver = None
self.log = log
+ # The local name of the remote (might be overridden by subclasses)
+ self.remote = "origin"
+
# Define properties here
# Properties allow us to "lazy load" various attributes, which also means
# that we can do clone actions without knowing things like the spec
@@ -961,6 +964,11 @@ class Commands(object):
else:
self.log.debug('Cloning %s' % giturl)
cmd.extend([giturl])
+
+ if not bare_dir:
+ # --bare and --origin are incompatible
+ cmd.extend(['--origin', self.remote])
+
self._run_command(cmd, cwd=path)
return
@@ -1009,14 +1017,14 @@ class Commands(object):
for branch in branches:
try:
# Make a local clone for our branch
- top_git.clone("--branch", branch, repo_path, branch)
+ top_git.clone("--branch", branch, '--origin', self.remote,
+ repo_path, branch)
- # Set the origin correctly
+ # Set the remote correctly
branch_path = os.path.join(top_path, branch)
branch_git = git.Git(branch_path)
- branch_git.config("--replace-all", "remote.origin.url", giturl)
- # Bad use of "origin" here, need to fix this when more than one
- # remote is used.
+ branch_git.config(
+ "--replace-all", "remote.%s.url" % self.remote, giturl)
except (git.GitCommandError, OSError), e:
raise rpkgError('Could not locally clone %s from %s: %s' %
(branch, repo_path, e))
@@ -1452,8 +1460,7 @@ class Commands(object):
self.log.debug('No local branch found, creating a new one')
totrack = None
for remote in remotes:
- # bad use of "origin" here, will have to be fixed
- if remote.replace('origin/', '') == branch:
+ if remote.endswith(branch):
totrack = remote
break
else:
diff --git a/src/rpkg.bash b/src/rpkg.bash
index 047c98d..a2e45b6 100644
--- a/src/rpkg.bash
+++ b/src/rpkg.bash
@@ -283,8 +283,7 @@ _rpkg_branch()
local git_options= format="--format %(refname:short)"
[[ -n $1 ]] && git_options="--git-dir=$1/.git"
- git $git_options for-each-ref $format 'refs/remotes/origin/*' \
- | sed 's,origin/,,'
+ git $git_options for-each-ref $format 'refs/remotes' | sed 's,.*/,,'
git $git_options for-each-ref $format 'refs/heads'
}
--
1.8.5.3
9 years, 8 months
New package/branch procedure w/ pkgdb2
by Pierre-Yves Chibon
Good morning everyone,
Couple of weeks back we started the discussion around the procedures to include
new packages or request new branches for an existing packages [ticket, 1].
The ticket that started this whole discussion is:
At the meeting [2] we started to browse multiple scenario of procedure we could
have around these processes.
In order to kick-off the discussion further, I have tried to summarize below the
procedure as it is nowadays and the two different procedures we came up with
during the meeting.
So here it is :)
Cheers,
Pierre
[1] https://fedorahosted.org/rel-eng/ticket/5931
[2] http://meetbot.fedoraproject.org/meetbot/fedora-meeting-1/2014-06-30/rele...
Current new-package procedure:
==============================
* packager opens a review-request on bugzilla
* reviewer sets the fedora-review flag to ?
* reviewer does the review
* reviewer sets the fedora-review flag to +
* packager creates the scm-request and set fedora-cvs flag to ?
* cvsadmin checks the review (check reviewer is a packager)
* cvsadmin processes the scm-request:
- Create git repo
- Create package in pkgdb
* cvsadmin sets fedora-cvs flag to +
New procedure (1)
=================
* packager opens a review-request on bugzilla
* reviewer sets the fedora-review flag to ?
* reviewer does the review
* reviewer sets the fedora-review flag to +
* packager goes to pkgdb2 to request new package
- precises package name
- precises package summary
- precises package branches
- precises link to review on bugzilla
* requests added to the scm admin queue
* cvsadmin checks the review (check reviewer is a packager¹)
* cvsadmin approves the creation of the package in pkgdb
* package creation is broadcasted on fedmsg
* git adjusted automatically
¹ we could check this automatically by checking which comment mentions 'approved'
and checking who set the fedora-review flag to +
New procedure (2) - Relies on fedmsg/bugzilla integration
=================
* packager opens a review-request on bugzilla
* reviewer sets the fedora-review flag to ?
* reviewer does the review
* reviewer sets the fedora-review flag to +
* automatically set fedora-cvs flag to ?
* cvsadmin checks the review (check reviewer is a packager)
* cvsadmin sets the fedora-cvs flag to +
* flag change is broadcasted onto fedmsg
* pkgdb automatically creates the package (w/ name and summary provided in the
review)
* packager goes to pkgdb2 to request new branches
* requests added to the scm admin queue
* cvsadmin approves the creation of the branches in pkgdb
* branch creation is broadcasted on fedmsg
* git adjusted automatically
9 years, 8 months
Re: New package/branch procedure w/ pkgdb2
by Rex Dieter
On 07/15/2014 11:36 AM, Thomas Spura wrote:
> There have been (many?) cases, where the reporter didn't want to finish
> the review process and another one took over the review request in the
> same bug.
That violates process. Just enforce it (and ask FESCo to sanction it if
you like).
-- Rex
9 years, 8 months
Additions to Fedora Server release package
by Stephen Gallagher
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This patch adds a hard requirement on Cockpit to fedora-release-server
and adds a new 80-server.preset for systemd to enable Cockpit and
rolekit by default. (The latter hasn't been added to the
fedora-release-server Requires: yet because the package isn't yet in
the distribution, but that should happen sometime today, at which time
I'll send a follow-up patch).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlPD7bAACgkQeiVVYja6o6OSrQCgg/qJDFA+ozbsTQnAijKLzLuQ
KqgAn3xbHhY4oSSVG9DCSEJMO/eatU1+
=DFeo
-----END PGP SIGNATURE-----
9 years, 8 months
#5942: Koji buildArch fails with OSError: [Errno 30] Read-only file system
by Fedora Release Engineering
#5942: Koji buildArch fails with OSError: [Errno 30] Read-only file system
-----------------------------+------------------------
Reporter: mizdebsk | Owner: rel-eng@…
Type: task | Status: new
Milestone: Fedora 20 Final | Component: koji
Keywords: | Blocked By:
Blocking: |
-----------------------------+------------------------
Koji buildArch task failed with {{{OSError: [Errno 30] Read-only file
system: '/var/tmp/koji/tasks/7078'}}}
See Koji task #7137078
{{{
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/koji/daemon.py", line 1161, in
runTask
response = (handler.run(),)
File "/usr/lib/python2.7/site-packages/koji/tasks.py", line 155, in run
self.createWorkdir()
File "/usr/lib/python2.7/site-packages/koji/tasks.py", line 181, in
createWorkdir
os.makedirs(self.workdir)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/var/tmp/koji/tasks/7078'
}}}
--
Ticket URL: <https://fedorahosted.org/rel-eng/ticket/5942>
Fedora Release Engineering <http://fedorahosted.org/rel-eng>
Release Engineering for the Fedora Project
9 years, 8 months