Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Dec 7, 2023
1 parent 753c1a9 commit 3ffaa39
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ ENTRYPOINT ["/usr/local/bin/roundup"]

RUN : &&\
pip install 'lasso.releasers~=1.0.0' 'lasso.requirements~=1.0.0' &&\
pip install 'git+https://github.com/NASA-PDS/lasso-issues.git@main' &&\
pip install install /usr/src/roundup &&\
:
6 changes: 4 additions & 2 deletions src/pds/roundup/_maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .errors import InvokedProcessError, MissingEnvVarError, RoundupError
from .step import ChangeLogStep as BaseChangeLogStep
from .step import Step, StepName, NullStep, DocPublicationStep, RequirementsStep
from .util import invoke, invokeGIT, TAG_RE, git_config, delete_tags
from .util import invoke, invokeGIT, TAG_RE, git_config, delete_tags, add_version_label_to_open_bugs
from lxml import etree
import logging, os, base64, subprocess, re

Expand Down Expand Up @@ -300,7 +300,9 @@ def execute(self):
if not match:
raise RoundupError(f'🐎 Stable workflow on tag «{tag}» but not a ``release/`` name!')
major, minor, micro = int(match.group(1)), int(match.group(2)), match.group(4)
_logger.debug('🔖 So we got version %d.%d.%s', major, minor, micro)
full_version = f'{major}.{minor}.{micro}'
_logger.debug('🔖 So we got version %s', full_version)
add_version_label_to_open_bugs(full_version)
if micro is None:
raise RoundupError('Invalid release version supplied in tag name. You must supply Major.Minor.Micro')
self.invokeMaven(['-DgenerateBackupPoms=false', f'-DnewVersion={major}.{minor}.{micro}', 'versions:set'])
Expand Down
7 changes: 5 additions & 2 deletions src/pds/roundup/_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .errors import MissingEnvVarError
from .step import ChangeLogStep as BaseChangeLogStep
from .step import Step, StepName, NullStep, RequirementsStep, DocPublicationStep
from .util import invoke, invokeGIT, TAG_RE, commit, delete_tags, git_config
from .util import invoke, invokeGIT, TAG_RE, commit, delete_tags, git_config, add_version_label_to_open_bugs
from lasso.releasers._python_version import TextFileDetective
import logging, os, re, shutil

Expand Down Expand Up @@ -127,10 +127,13 @@ def execute(self):
raise RoundupError(f'🐎 Stable tag of «{tag}» but not a ``release/`` tag')

major, minor, micro = int(match.group(1)), int(match.group(2)), match.group(4)
_logger.debug('🔖 So we got version %d.%d.%s', major, minor, micro)
full_version = f'{major}.{minor}.{micro}'
_logger.debug('🔖 So we got version %s', full_version)

if micro is None:
raise RoundupError('Invalid release version supplied in tag name. You must supply Major.Minor.Micro')

add_version_label_to_open_bugs(full_version)
_logger.debug("Locating VERSION.txt to update with new release version.")
try:
version_file = TextFileDetective.locate_file(self.assembly.context.cwd)
Expand Down
2 changes: 1 addition & 1 deletion src/pds/roundup/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, context):


class PDSAssembly(Assembly):
'''The PDS-flavored assembly which has 9 different steps'''
'''The PDS-flavored assembly which has 13 different steps'''
pdsSteps = [
StepName.preparation,
StepName.unitTest,
Expand Down
4 changes: 2 additions & 2 deletions src/pds/roundup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def main():

# Sanity check in GitHub Acions logs: show the version of ``pds-github-util`` by calling
# ``--version`` on any one of its programs.
pdsGitHubUtilVersion = invoke(['maven-release', '--version']).strip()
_logger.info('🗺 The version of ``pds-github-util`` I shall be using: %s', pdsGitHubUtilVersion)
version = invoke(['lasso-issues', '--version']).strip()
_logger.info('🗺 The version of ``pds-github-util`` I shall be using: %s', version)

# Here we go daddy
_assemblies[args.assembly](context).roundup()
Expand Down
12 changes: 11 additions & 1 deletion src/pds/roundup/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
'''🤠 PDS Roundup — Utilities'''

from .errors import InvokedProcessError
import subprocess, logging, re
import subprocess, logging, re, os


_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -42,6 +43,15 @@ def populateEnvVars(env):
return copy


def add_version_label_to_open_bugs(version):
_logger.debug('Adding version label to open bugs')
owner, repo = os.getenv('GITHUB_REPOSITORY').split('/')
invoke([
'add-version-label-to-open-bugs', '--labelled-version', version,
'--token', os.getenv('ADMIN_GITHUB_TOKEN'), '--github-org', owner, '--github-repo', repo,
])


def invoke(argv):
'''Execute a command within the operating system, returning its output. On any error,
raise ane exception. The command is the first element of ``argv``, with remaining elements
Expand Down

0 comments on commit 3ffaa39

Please sign in to comment.