Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Checks the status of review environments assigned to a specific pull request/issue.
The commands are only available in sfp-pro (August 24 onwards) and currently limited to GitHub. Using these commands requires an equivalent APP_ID & PRIVATE_KEY in your environment variable.
--repository
: The repository path that stores the pool lock (default: current repo).
--issue
: The pull request number to assign the environment to, or a unique id that will be used subsequently to identify (required).
--pool
: The name of the pool to filter by (optional).
--poolType
: The type of the pool to filter by, either sandbox
or scratchorg
(optional).
--branch
: The pull request branch to filter by (optional).
Searches the repository's stored environment data for environments associated with the specified issue.
Returns details of any found environments, including:
Environment name or username
Environment type (sandbox or scratch org)
Pool the environment belongs to
Associated pull request branch
Environment status and expiration date
This command is typically used as needed, not within the regular pull request workflow.
It's useful for verifying environment details or troubleshooting.
Fetches a review environment from a specified pool and assigns it to a pull request/issue.
The commands are only available in sfp-pro (August 24 onwards) and currently limited to GitHub. Using these commands requires an equivalent APP_ID & PRIVATE_KEY in your environment variable.
--repository
: The repository path that stores the pool lock (default: current repo).
--pool
: The name of the pool to fetch the review environment from (required).
--poolType
: The type of the pool, either sandbox
or scratchorg
(required).
--branch
: The pull request branch to fetch the environment for (required).
--issue
: The pull request number to assign the environment to, or a unique id that will be used subsequently to identify (required).
--devhubAlias
: The DevHub alias associated with the pool (default: devhub
).
--wait
: Time in minutes to wait for an environment to become available (default: 20).
--leaseFor
: Time in minutes typically this environment is leased for during similar operations
Checks if an environment is already assigned to the issue.
If assigned, verifies if the previous lease has expired based on the leaseFor
duration. If a job has not released the environment within the earlier mentioned leaseFor, the new job will be provided the environment
If no environment is assigned or the environment assigned to the issue has expired, fetches a new environment from the pool.
Automatically marks the fetched or reassigned environment as "InUse".
Waits for up to the specified wait
time if no environment is immediately available.
The environment remains valid for 24 hours from assignment, regardless of the leaseFor
duration.
The leaseFor
parameter determines how long the current process can use the environment before it becomes available for reassignment for a different job within the same issue.
Review environments are a crucial component in the CI/CD workflow of flxbl projects. They provide isolated, ephemeral environments (either scratch orgs or sandboxes) for validating deployments, running tests, and performing acceptance testing during the pull request process.
Isolation: Each pull request gets its own environment, preventing conflicts between different features or bug fixes.
Reproducibility: Environments are created from consistent pool configurations, ensuring predictable testing conditions.
Early Validation: Catch deployment issues early in the development process.
Automated Testing: Run tests against review environments to verify changes and prevent regressions.
Collaboration: Provide a shared space for team members to perform acceptance testing and provide feedback.
Compliance: Enforce governance policies and organizational standards before merging changes.
Environment Pools: Review environments are managed in pools, which can be either sandbox or scratch org pools.
Fetching: When a pull request is opened or updated, a review environment is fetched from the appropriate pool. If an environment is already assigned to the issue, it may be reused if its lease hasn't expired.
Usage: The environment is populated with the pull request changes and used for automated checks, manual testing, and review processes.
Leasing: Environments are leased for specific durations to manage resource usage efficiently. While an environment is valid for 24 hours, it can be leased for shorter periods for specific processes.
Status Management: Throughout its lifecycle, an environment's status can be transitioned between 'InUse', 'Available', and 'Expired' to reflect its current state and availability.
Extension: If needed, an environment's overall validity can be extended beyond the initial 24-hour period.
Unassignment: When no longer needed, environments are unassigned from issues and either returned to the pool or marked for deletion.
This lifecycle is managed through a set of sfp reviewenv
commands, which automate the process of fetching, checking, transitioning, extending, and unassigning review environments.
Updates the status of a review environment assigned to a specific issue.
The commands are only available in sfp-pro (August 24 onwards) and currently limited to GitHub. Using these commands requires an equivalent APP_ID & PRIVATE_KEY in your environment variable.
--repository
: The repository path that stores the pool lock (default: current repo).
--issue
: The pull request number to assign the environment to, or a unique id that will be used subsequently to identify (required).
--status
: The status to transition the review environment to (required). Options: 'InUse', 'Available', 'Expired'
Locates the environment assigned to the specified issue.
Updates the status of the environment to the specified status.
'InUse': The environment is currently being used by automated checks or another automated process.
'Available': The environment is available for reuse by another automation within the same issue's context.
'Expired': The environment will be picked up by Pool commands for deletion.
This command doesn't reflect the state of the pull request, but rather the current usage state of the environment within the issue's context.
Transitioning to 'Available' before the lease expires allows for efficient reuse within the same issue.
Removes the assignment of a review environment from an issue.
The commands are only available in sfp-pro (August 24 onwards) and currently limited to GitHub. Using these commands requires an equivalent APP_ID & PRIVATE_KEY in your environment variable.
--repository
: The repository path that stores the pool lock (default: current repo).
--issue
: The pull request number to assign the environment to, or a unique id that will be used subsequently to identify (required).
--returntopool
: If set to true, the environment will be returned to the pool for reuse. If false or not set, it will be marked as expired.
Locates the environment assigned to the specified issue.
Removes the assignment of the environment from the issue.
Based on the --returntopool
flag:
If true: Marks the environment as available for reuse within the pool.
If false or not set: Marks the environment as expired, to be picked up by Pool commands for deletion.
This command should be used when a review environment is no longer needed for an issue.
Consider carefully whether to return the environment to the pool or mark it as expired based on your project's needs and the state of the environment.
Extends the lease of a review environment assigned to a specific issue.
The commands are only available in sfp-pro (August 24 onwards) and currently limited to GitHub. Using these commands requires an equivalent APP_ID & PRIVATE_KEY in your environment variable.
--repository
: The repository path that stores the pool lock (default: current repo).
--issue
: The pull request number to assign the environment to, or a unique id that will be used subsequently to identify (required).
Locates the environment assigned to the specified issue.
Extends the overall validity of the environment by an additional 24 hours from the current time.
This command is useful when more time is needed for thorough testing or when waiting for stakeholder approval.
It extends the overall validity of the environment, not the lease time for a specific process.
Use judiciously to avoid unnecessarily tying up resources.
When working with review environments in flxbl projects, consider the following to optimize your workflow and resource usage:
Lease Management:
Use the --leaseFor
parameter in sfp reviewenv fetch
to set appropriate lease durations for your processes.
Balance between long enough leases to complete processes and short enough to allow efficient reuse.
Wait Times:
Utilize the --wait
parameter in sfp reviewenv fetch
to allow for environment availability in busy systems.
Set wait times based on your project's typical environment turnover time.
Status Transitions:
If a process completes before its lease expires, transition the environment to 'Available' status to allow earlier reuse within the same issue.
Keep environment statuses up-to-date to reflect their current use accurately.
Automation:
Integrate sfp reviewenv
commands into your CI/CD pipelines for automatic environment management.
Include proper lease handling and status transitions in your automated workflows.
Efficient Reuse:
Understand the interplay between the 24-hour validity period and the leaseFor
duration.
Design your workflows to maximize environment reuse efficiency within issues.
Timely Unassignment:
Unassign environments promptly when they're no longer needed to free up resources.
Consider whether to return to the pool or mark as expired based on the environment's state and your project's needs.
Pool Management:
Regularly review and manage your environment pools.
Ensure a healthy balance of available environments, considering both the number of environments and typical lease durations.
Extension Judiciousness:
Use sfp reviewenv extend
only when necessary to avoid tying up resources unnecessarily.
Consider implementing approval processes for extensions in long-running projects.
Monitoring and Logging:
Implement monitoring for environment usage, lease times, and pool availability.
Maintain logs of environment assignments and transitions for troubleshooting and optimization.
User Education:
Ensure team members understand the review environment lifecycle and the impact of their actions on resource availability.
Provide guidelines for efficient use of review environments in your development processes.
By considering these points, you can streamline your development process, improve resource utilization, and ensure efficient use of review environments in your flxbl projects.