Skip to content

Bug 2037926 - landoscript: introduce file-specific version_bump scopes#1448

Open
JohanLorenzo wants to merge 2 commits into
mozilla-releng:masterfrom
JohanLorenzo:bug-2037926
Open

Bug 2037926 - landoscript: introduce file-specific version_bump scopes#1448
JohanLorenzo wants to merge 2 commits into
mozilla-releng:masterfrom
JohanLorenzo:bug-2037926

Conversation

@JohanLorenzo
Copy link
Copy Markdown
Contributor

@JohanLorenzo JohanLorenzo commented May 25, 2026

Merge order

  1. fxci-config staging #1012 — apply-staging + merge first
  2. This PR — deploy to staging via dev-landoscript, merge to master
  3. mozilla-taskgraph #215 — merge + publish
  4. xpi-manifest — update mozilla-taskgraph pin, trigger staging e2e test
  5. fxci-config production (separate PR) — after staging verification
  6. firefox gecko_taskgraph — Phabricator + uplift
  7. fxci-config cleanup (separate PR) — remove old general version_bump grants
  8. scriptworker-scripts cleanup (separate PR) — remove transition fallback from validate_scopes

Bug 2037926

@JohanLorenzo JohanLorenzo changed the title bug 2037926 - landoscript: accept file-specific version_bump scopes Bug 2037926 - landoscript: accept file-specific version_bump scopes May 25, 2026
@JohanLorenzo JohanLorenzo changed the title Bug 2037926 - landoscript: accept file-specific version_bump scopes Bug 2037926 - landoscript: introduce file-specific version_bump scopes May 26, 2026
@JohanLorenzo JohanLorenzo marked this pull request as ready for review May 26, 2026 09:53
@JohanLorenzo JohanLorenzo requested a review from a team as a code owner May 26, 2026 09:53
@JohanLorenzo JohanLorenzo requested a review from jcristau May 26, 2026 09:53
@jcristau
Copy link
Copy Markdown
Contributor

jcristau commented May 26, 2026

Merge order

  1. fxci-config staging #1012 — apply-staging + merge first

  2. This PR — deploy to staging via dev-landoscript, merge to master

  3. mozilla-taskgraph #215 — merge + publish

  4. xpi-manifest — update mozilla-taskgraph pin, trigger staging e2e test

  5. fxci-config production (separate PR) — after staging verification

  6. firefox gecko_taskgraph — Phabricator + uplift

  7. fxci-config cleanup (separate PR) — remove old general version_bump grants

  8. scriptworker-scripts cleanup (separate PR) — remove transition fallback from validate_scopes

I'd probably do 5 before merging anything to mozilla-taskgraph, if that gets picked up anywhere in the mean time we'd break production.

Copy link
Copy Markdown
Contributor

@jcristau jcristau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly sure how to change it but I'm not super happy with the way this makes scope validation functions more complex, this is critical code that would ideally remain as straightforward as possible.

expected_scopes = {f"project:releng:lando:repo:{lando_repo}"}
expected_scopes.update(f"project:releng:lando:action:{a}" for a in actions if a != "version_bump")
if "version_bump" in actions and "project:releng:lando:action:version_bump" not in scopes:
expected_scopes.update(f"project:releng:lando:action:version_bump:file:{f}" for f in (version_bump_files or []))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this ugly (version_bump_files or []), consider having the caller pass an empty list, or adding and version_bump_files to the if?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree; this is a case where more verbose/simpler code would be beneficial now that the logic is less than trivial. I think it also has a bug in it as currently written? (I don't see any way that project:releng:lando:action:version_bump is ever in expected_scopes?)

How about something like this?

def validate_scopes(scopes, lando_repo, actions, version_bump_files=[]):
  expected_scopes = {f"project:releng:lando:repo:{lando_repo}"}
  for action in actions:
    if action == "version_bump":
      if "project:releng:lando:action:version_bump" in scopes:
        # It's superfluous to add this to the expected scopes, but a bit more clear/correct to do so? This block goes away when we stop supporting this legacy scope anyways.
        expected_scopes.add("project:releng:lando:action:version_bump")
      else:
        expected_scopes.update(f"project:releng:lando:action:version_bump:file:{f}" for f in version_bump_files)
    else:
      expected_scopes.add(f"project:releng:lando:action:{action}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants