-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul versions.py
to handle generic named versions
#100
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 tasks
Update descriptions and docs to the latest Update actions/cache version for consistency
praveek
approved these changes
Nov 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Questions for reviewers
x.0.1
? Or since no production repo workflows have adopted this tag yet (and hence created Actions caches etc), should we move the existingx.0.0
tags to the state after this PR is merged?versions.yml
file? It is shared across both iOS and Android workflows. Currently it usesgha-ios-5.0.0
Note
Example job runs
Updating versions using new directory path feature
Android job run: https://github.com/timkimadobe/aepsdk-commons/actions/runs/11904629865
iOS job run: https://github.com/timkimadobe/aepsdk-commons/actions/runs/11904637349
Validating workflow file tags (that is, non-update run): https://github.com/timkimadobe/aepsdk-commons/actions/runs/11848563767/job/33020308748
Previous usage for non-workflow version update (that is, no
WORKFLOW_TOKEN
, and using default GITHUB_TOKEN): https://github.com/timkimadobe/aepsdk-edge-ios/actions/runs/11848235149/job/33019413939Description
This PR overhauls the
versions.py
logic to be able to handle more dependency version cases (specifically updating GitHub Action workflow yaml files).Basically, the previous version update logical hierarchy was dependent on the top level version's file paths + pattern types:
With the changes in this PR, dependencies are also able to specify their own completely custom file paths + pattern types:
Now, the
-p --paths
flag acts as the default file paths for both the main version and dependencies, and each dependency can specify their own override paths + pattern types that override the default ones.File changes
versions.py
Instead of
process_file_version
handling both final pattern construction and applying the patterns to the file, it is now only responsible for the latter.parse_paths
->generate_versioned_patterns
andparse_dependencies
->generate_dependency_patterns
General logic updates
versions.yml
Updates to accommodate Actions-based workflow file changes; a PAT is required to provide the required
workflows
permission:https://github.com/orgs/community/discussions/35410#discussioncomment-7645702
To this end, the workflow has been updated to use the optionally provided input secret
WORKFLOW_TOKEN
, and used for the initial checkout of the repo (meaning that the scope of permissions provided to the token will be used for git operations going forward in the workflow)General logic updates
Linked comment archive
ios-update-workflow-versions.yml
Newly created action taking advantage of the changes in the version workflow and script to update the iOS reusable workflow tags.
Removed
Dependency related classes and logic:
DEPENDENCY_FILE_TYPES
@dataclass class Dependency
Intermediate processing classes and logic:
@dataclass class FilePatternGroup
Usage examples
Version validation
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: