Bugfix: Removed most of the usage of UserInfo.getSessionId()#995
Open
jongpie wants to merge 14 commits into
Open
Bugfix: Removed most of the usage of UserInfo.getSessionId()#995jongpie wants to merge 14 commits into
jongpie wants to merge 14 commits into
Conversation
…e previously reported issues related to quiddity & user session ID * Added an example email service, ExampleInboundEmailService, to have a full solution to re-test issue #155 * Added Experience Cloud metadata SSO logins, auth provider, and custom registration handlers, to have a full solution to re-test issue #224
…Id() - it can't cause problems if we don't use it ^_^ Now the only place that the session ID is referenced is when using the REST save method. The user session ID is synchronously passed to the internal class RestApiSaver - and passing it like this will (intentionally) force a synchronous runtime exception when there isn't a session ID (instead of it silently failing async)
…t a time), thanks to @jamessimone and @mitchspano for getting the devhub limit increased!
…e much easier - Split common CI setup into two composite actions, .github/actions/setup-npm/action.yml and .github/actions/authorize-dev-hub/action.yml - Extracted the scratch-org test sections into a new reusable workflow at .github/workflows/test-scratch-org.yml, with parameters for definition file, OmniStudio install, optional extra metadata directory, and Codecov upload toggle - Converted the 7 near-identical scratch-org jobs in build.yml into a single matrix-driven caller of the reusable workflow. Adding a new scratch org is now one matrix row; downstream `needs:` lists shrink from 8/9 names to 3. - Pipeline scratch orgs are now create with `--alias pipeline-scratch-org` and a `--description` containing the GitHub run ID, so the in-job deletion can make sure it's targeting the correct scratch org - Scratch org delete step has been updated to use `continue-on-error: true` so a transient delete failure does not mask a real test failure.
…to run an hourly cleanup of orphaned pipeline scratch orgs older than 2 hours * For each scratch org, it parses the run ID out of the description and asks the GitHub REST API whether the owning run is still active. Orgs whose run is queued or in-progress are skipped, so a slow but healthy build never has its scratch org deleted while the job is still running.
…ng the previously used versions, built for Node 20)
… JWT file so that it's still available for subsequent sf CLI commands I thought deleting it would be safe & a good idea for security - but it broke everything ~_~
…de script to export the current user's username to .env so that deploying the example email service works in the pipeline
…t's causing pipeline issues and is out o' scope
…job run at the same time as (instead of as a prerequisite for) 'lwc-jest-tests' and 'scratch-org-tests'
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #995 +/- ##
==========================================
+ Coverage 93.76% 93.79% +0.03%
==========================================
Files 58 58
Lines 6335 6319 -16
Branches 204 204
==========================================
- Hits 5940 5927 -13
+ Misses 393 390 -3
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
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.
Core Unlocked Package Changes
Fixed #761 and fixed #964 by updating
LoggerApex class to remove most of the usage ofSystem.UserInfo.getSessionId()- it can't cause problems if we don't use it 😆To help validate that this change doesn't cause any regressions, I've added some extra metadata (used only in the pipeline & testing) to recreate previously reported issues related to quiddity & user session ID:
ExampleInboundEmailService, to have a full solution to re-test. Previously, I only had the Apex classExampleInboundEmailHandler, but I needed the service itself to do a full end-to-end test.With the extra metadata in place & the changes in
Logger, everything still seems to be working as expected (without the use ofSystem.UserInfo.getSessionId()). More testing will be done prior to merging this.Pipeline Changes
Pipeline overhaul: made some big restructuring of
.github/workflows/build.ymlfor maintainability and speed improvementssetup-npmandauthorize-dev-hub) for some stuff that's used throughout the build (and was previously duplicated a bunch)test-scratch-org.yml), with parameters to control scratch def file, OmniStudio toggle, optional extra-metadata directory, and Codecov togglebuild.ymlto use the new actions & workflows, which eliminates a ton of duplicationdelete-stale-scratch-orgs.yml) to delete orphaned pipeline scratch orgs older than 2 hours (it'll skip any scratch orgs tied to GitHub Actions that are still running)