Skip to content

Use alias-based artifact naming in docs workflows#19111

Merged
harupy merged 11 commits intomasterfrom
copilot/update-artifact-upload-steps
Nov 29, 2025
Merged

Use alias-based artifact naming in docs workflows#19111
harupy merged 11 commits intomasterfrom
copilot/update-artifact-upload-steps

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

Related Issues/PRs

#xxx

What changes are proposed in this pull request?

Changed artifact naming in docs workflows from generic pr_number to alias-based system. This prepares the infrastructure for creating doc previews for both PRs and push to master branch.

Changes:

  • docs.yml: Upload artifact as alias (consistent name for all cases), save full alias value like pr-123 to alias.txt file, rename step to "Save alias", use ALIAS environment variable
  • preview-docs.yml: Download artifact by name alias (not pattern matching), read alias from /tmp/alias.txt, rename steps to "Download alias" and "Set alias", update step IDs and variable names to use generic "alias" terminology instead of "pr_number", add "Extract PR number" step to extract numeric PR number from alias for comment posting, conditionally post preview comment only for PR aliases using startsWith function
  • Both files: Use generic naming that works for both PR numbers (e.g., pr-123) and other aliases (e.g., master for master branch)

The alias value is stored with its prefix (e.g., pr-123 instead of just 123) to make it self-contained and ready for use with non-PR aliases like master. The artifact is consistently named alias for all cases, making it easy to extend to master branch previews in the future. PR number extraction is simplified using startsWith(steps.alias.outputs.value, 'pr-') to conditionally run only for PR aliases. The "Extract PR number" step is positioned right before the "Create preview link" step for better logical flow. The ALIAS value is passed through the step's env field to prevent shell injection vulnerabilities.

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

YAML validation and pre-commit hooks pass.

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

Yes should be selected for bug fixes, documentation updates, and other small changes. No should be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.

What is a minor/patch release?
  • Minor release: a release that increments the second part of the version number (e.g., 1.2.0 -> 1.3.0).
    Bug fixes, doc updates and new features usually go into minor releases.
  • Patch release: a release that increments the third part of the version number (e.g., 1.2.0 -> 1.2.1).
    Bug fixes and doc updates usually go into patch releases.
  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)
Original prompt

docs.yml and preview-docs.yml upload/download an artifact containing the PR number to create a preview for doc changes. Instead of PR number, upload/download alias "pr-" instead, and rename/adjust relevant steps. This makes it easier to create a preview for push to master branch (no need to implement this)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@harupy harupy marked this pull request as ready for review November 29, 2025 10:27
@github-actions
Copy link
Contributor

@Copilot Thank you for the contribution! Could you fix the following issue(s)?

⚠ Invalid PR template

This PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out.

Copilot AI and others added 2 commits November 29, 2025 10:31
- Updated docs.yml to upload artifact with name "pr-<number>"
- Updated preview-docs.yml to download artifact with pattern "pr-*"
- Renamed steps from "PR number" to "PR alias" for clarity
- This makes it easier to create previews for push to master branch

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Simplified step names for better clarity

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update artifact upload for PR previews Use "pr-<number>" artifact name instead of "pr_number" in docs workflows Nov 29, 2025
Copilot AI requested a review from harupy November 29, 2025 10:35
@harupy
Copy link
Member

harupy commented Nov 29, 2025

@copilot For master branch preview, "master" will be used as an alias. PR might sound confusing. Let's adjust file/step names

Copilot AI and others added 2 commits November 29, 2025 10:41
- Changed file from pr_number.txt to alias.txt
- Changed step ID from pr_number to alias
- Changed output from pr_number to value
- Changed environment variable from PR_NUMBER to ALIAS
- This avoids confusion since the alias won't always be a PR number (e.g., "master" for master branch)

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
- Changed to save "pr-123" instead of just "123" in alias.txt
- Updated Netlify deploy to use alias directly without adding prefix
- This makes the alias self-contained and ready for non-PR aliases like "master"

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 29, 2025

@copilot For master branch preview, "master" will be used as an alias. PR might sound confusing. Let's adjust file/step names

Updated file names, step names, and variable names to use generic "alias" terminology. The alias file now contains the full alias value (e.g., "pr-123" for PRs, ready for "master" for master branch). See commits c130639 and d90730a.

Copilot AI changed the title Use "pr-<number>" artifact name instead of "pr_number" in docs workflows Use alias-based artifact naming in docs workflows Nov 29, 2025
Copilot AI requested a review from harupy November 29, 2025 10:46
Copilot AI and others added 3 commits November 29, 2025 10:57
- Changed artifact name from "pr-<number>" to just "alias"
- Changed download from pattern matching to specific artifact name
- Simplified file paths from /tmp/pr-*/alias.txt to /tmp/alias.txt
- Set ALIAS env var directly to pr-<number> value
- This makes the artifact name consistent for all cases (PR or master)

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
- Added "Extract PR number" step to extract numeric PR number from alias
- Updated "Create preview link" step to use extracted PR number
- This allows the preview-comment.js script to work correctly with the GitHub API
- The script needs just the number (e.g., "123") not the full alias (e.g., "pr-123")

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
- Updated extraction logic to use regex pattern matching
- Added is_pr flag to detect if alias is a PR (pr-<number>) or not (e.g., master)
- Added conditional to "Create preview link" step to only run for PR aliases
- This ensures the workflow works correctly for both PRs and master branch

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the documentation workflow artifacts to use an alias-based naming system instead of bare PR numbers. The change prepares the infrastructure to support documentation previews for both pull requests (e.g., pr-123) and direct pushes to master branch (e.g., master).

Key changes:

  • Artifact naming changed from pr_number to alias with prefixed values (e.g., pr-123 instead of 123)
  • Added PR number extraction logic with regex pattern matching to distinguish between PR and non-PR aliases
  • Made preview comment posting conditional on PR aliases only

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/docs.yml Updates artifact creation to use alias naming with pr- prefix and saves to alias.txt
.github/workflows/preview-docs.yml Updates artifact download to use alias name, adds extraction logic to parse PR numbers from aliases, and conditionalizes PR comment posting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI and others added 2 commits November 29, 2025 11:13
- Moved "Extract PR number" step to right before "Create preview link" step
- This improves logical flow as PR number is only used by the preview link step

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
- Replaced `steps.pr_number.outputs.is_pr == 'true'` with `startsWith(steps.alias.outputs.value, 'pr-')`
- Simplified "Extract PR number" step by removing conditional logic
- Both steps now use the same startsWith condition for consistency

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot AI requested a review from harupy November 29, 2025 11:18
@harupy
Copy link
Member

harupy commented Nov 29, 2025

@copilot plz update the pr description. follow the pull request template

Copy link
Contributor Author

Copilot AI commented Nov 29, 2025

@copilot plz update the pr description. follow the pull request template

Updated the PR description to follow the pull request template format.

@github-actions github-actions bot added area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs. labels Nov 29, 2025
- Moved ALIAS from inline interpolation to env field in Extract PR number step
- This prevents potential shell injection by having GitHub Actions properly escape the value

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot AI requested a review from harupy November 29, 2025 11:45
@harupy harupy enabled auto-merge November 29, 2025 12:21
@harupy harupy added this pull request to the merge queue Nov 29, 2025
Merged via the queue into master with commit d1b701d Nov 29, 2025
58 of 79 checks passed
@harupy harupy deleted the copilot/update-artifact-upload-steps branch November 29, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants