You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Sahlberg <da...@gmail.com> on 2024/09/25 06:20:05 UTC
release.py
Hi,
I'm trying to read up on release.py (planning to make one of the upcoming
releases - no promises I'll be done in time for 1.14.4 though).
There are quite a few cases where there is a dry_run parameter, for example
in run_command:
[[[
def run_command(cmd, verbose=True, hide_stderr=False, dry_run=False):
...
if not dry_run:
subprocess.check_call(cmd, stdout=stdout, stderr=stderr)
else:
print(' ## dry-run; not executed')
]]]
Following the breadcrumbs, this parameter seems to be set from the command
line arguments (for example in make_release_branch):
...dry_run=args.dry_run...
However I can't figure out how args.dry_run is set. I was looking in main,
where the parser is setup but no trace of dry_run. Is it missing an
add_argument or am I missing something?
[[[
Index: release.py
===================================================================
--- release.py (revision 1920893)
+++ release.py (working copy)
@@ -1719,6 +1719,9 @@
parser.add_argument('--username',
help='Username for committing to ' + svn_repos +
' or ' + dist_repos + '.')
+ parser.add_argument('--dry-run', action='store_true',
+ help='''Just show the commands to be executed, don't
+ actually commit anything.''')
subparsers = parser.add_subparsers(title='subcommands')
# Setup the parser for the build-env subcommand
]]]
Kind regards,
Daniel
Re: release.py
Posted by Daniel Sahlberg <da...@gmail.com>.
Den fre 4 okt. 2024 kl 09:23 skrev Branko Čibej <br...@apache.org>:
> On 25. 9. 24 08:20, Daniel Sahlberg wrote:
>
(snip)
>
> However I can't figure out how args.dry_run is set. I was looking in main,
> where the parser is setup but no trace of dry_run. Is it missing an
> add_argument or am I missing something?
>
>
>
> You're not missing anything. I suspect those subcommands that initialize
> dry_run from args are never even used, because they would fail.
>
> I recommend against adding a global --dry-run option, it would only
> obscure such uses. It looks like it was never properly implemented
> throughout the script, only for some subcommands and not even consistently
> for those.
>
Thanks Brane!
I was actually missing something: --dry-run is initialized for
create-release-branch and write-release-notes and it is described in the
help for those subcommands. I agree that it shouldn't be added as a global
option.
There's quite a bit of release.py that should be reviewed and cleaned up
> (e.g., I don't think we use the buildbot update command at all).
>
I'll start by taking a look at all the places where --dry-run is used and
cleaning up those.
As you mention, the Buildbot code is broken after Infra migrated to
Buildbot 2 (which store the configuration in another path), but it seems to
be possible to resolve. Now, we COULD decided to kill off Buildbot
completely after Timfei's work on GitHub Actions (need to check what they
duplicate compared to Buildbot and if we instead should add the missing
stuff in GHA). That should probably be broken out to a separate discussion.
I'll also take a general look, including adding subcommand --dry-run's if
missing.
Kind regards,
Daniel
Re: release.py
Posted by Branko Čibej <br...@apache.org>.
On 25. 9. 24 08:20, Daniel Sahlberg wrote:
> Hi,
>
> I'm trying to read up on release.py (planning to make one of the
> upcoming releases - no promises I'll be done in time for 1.14.4 though).
>
> There are quite a few cases where there is a dry_run parameter, for
> example in run_command:
>
> [[[
> def run_command(cmd, verbose=True, hide_stderr=False, dry_run=False):
> ...
> if not dry_run:
> subprocess.check_call(cmd, stdout=stdout, stderr=stderr)
> else:
> print(' ## dry-run; not executed')
> ]]]
>
> Following the breadcrumbs, this parameter seems to be set from the
> command line arguments (for example in make_release_branch):
> ...dry_run=args.dry_run...
>
> However I can't figure out how args.dry_run is set. I was looking in
> main, where the parser is setup but no trace of dry_run. Is it missing
> an add_argument or am I missing something?
You're not missing anything. I suspect those subcommands that initialize
dry_run from args are never even used, because they would fail.
I recommend against adding a global --dry-run option, it would only
obscure such uses. It looks like it was never properly implemented
throughout the script, only for some subcommands and not even
consistently for those.
There's quite a bit of release.py that should be reviewed and cleaned up
(e.g., I don't think we use the buildbot update command at all).
-- Brane