Use alias-based artifact naming in docs workflows#19111
Conversation
|
@Copilot Thank you for the contribution! Could you fix the following issue(s)? ⚠ Invalid PR templateThis PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out. |
- 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 For master branch preview, "master" will be used as an alias. PR might sound confusing. Let's adjust file/step names |
- 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>
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. |
- 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>
There was a problem hiding this comment.
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_numbertoaliaswith prefixed values (e.g.,pr-123instead of123) - 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.
- 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 plz update the pr description. follow the pull request template |
Updated the PR description to follow the pull request template format. |
- 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>
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
Changed artifact naming in docs workflows from generic
pr_numberto alias-based system. This prepares the infrastructure for creating doc previews for both PRs and push to master branch.Changes:
docs.yml: Upload artifact asalias(consistent name for all cases), save full alias value likepr-123toalias.txtfile, rename step to "Save alias", useALIASenvironment variablepreview-docs.yml: Download artifact by namealias(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 usingstartsWithfunctionpr-123) and other aliases (e.g.,masterfor master branch)The alias value is stored with its prefix (e.g.,
pr-123instead of just123) to make it self-contained and ready for use with non-PR aliases likemaster. The artifact is consistently namedaliasfor all cases, making it easy to extend to master branch previews in the future. PR number extraction is simplified usingstartsWith(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'senvfield to prevent shell injection vulnerabilities.How is this PR tested?
YAML validation and pre-commit hooks pass.
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow 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" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould 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?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.