Skip to content

Commit

Permalink
Bug 1862794 - Use function calls instead of const val for version and…
Browse files Browse the repository at this point in the history
… channel fields in Gecko object
  • Loading branch information
gabrielluong committed Nov 8, 2023
1 parent 0bc1f9e commit ce1435d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/android_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def _update_gv_version(
contents = ac_repo.get_contents(get_gecko_file_path(ac_major_version), ref=branch)
content = contents.decoded_content.decode("utf-8")
new_content = content.replace(
f'const val version = "{old_gv_version}"',
f'const val version = "{new_gv_version}"',
f'fun version() = "{old_gv_version}"',
f'fun version() = "{new_gv_version}"',
)
if content == new_content:
raise Exception(
Expand Down
4 changes: 2 additions & 2 deletions src/relbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@


DEFAULT_ORGANIZATION = "st3fan"
DEFAULT_AUTHOR_NAME = "MickeyMoz"
DEFAULT_AUTHOR_EMAIL = "sebastian@mozilla.com"
DEFAULT_AUTHOR_NAME = "Gabriel Luong"
DEFAULT_AUTHOR_EMAIL = "gabriel.luong@gmail.com"
USAGE = "usage: relbot <android-components|reference-browser> command..." # noqa E501


Expand Down
4 changes: 2 additions & 2 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_current_embedded_ac_version(repo, release_branch_name, target_path=""):

def match_gv_version(src):
"""Find the GeckoView version in the contents of the given Gecko.kt file."""
if match := re.compile(r'version = "([^"]*)"', re.MULTILINE).search(src):
if match := re.compile(r'version\(?\)? = "([^"]*)"', re.MULTILINE).search(src):
return validate_gv_version(match[1])
raise Exception("Could not match the version in Gecko.kt")

Expand All @@ -90,7 +90,7 @@ def get_current_gv_version(ac_repo, release_branch_name, ac_major_version):
def match_gv_channel(src):
"""Find the GeckoView channel in the contents of the given Gecko.kt file."""
if match := re.compile(
r"val channel = GeckoChannel.(NIGHTLY|BETA|RELEASE)", re.MULTILINE
r"channel\(?\)? = GeckoChannel.(NIGHTLY|BETA|RELEASE)", re.MULTILINE
).search(src):
return validate_gv_channel(match[1].lower())
raise Exception("Could not match the channel in Gecko.kt")
Expand Down

0 comments on commit ce1435d

Please sign in to comment.