-
Notifications
You must be signed in to change notification settings - Fork 40
Make SCIM user table migrations opt-in instead of auto-loading #154
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
Merged
arietimmerman
merged 8 commits into
master
from
copilot/fix-default-migration-inclusion
Nov 21, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
24a5b8e
Initial plan
Copilot 59f2624
Make migrations optional via publishing instead of auto-loading
Copilot d043395
Add test for publishable migrations
Copilot 09023eb
Improve test to use artisan command instead of accessing static property
Copilot 0d9e2fd
Publish SCIM migrations in Docker build process
Copilot a6da5ec
Add roles field to SCIM user migration
Copilot 48592dd
support for roles attribute
arietimmerman e61e7e8
Fix
arietimmerman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <?php | ||
|
|
||
| namespace ArieTimmerman\Laravel\SCIMServer\Tests; | ||
|
|
||
| use ArieTimmerman\Laravel\SCIMServer\ServiceProvider; | ||
| use Illuminate\Support\Facades\Artisan; | ||
| use Orchestra\Testbench\TestCase as BaseTestCase; | ||
|
|
||
| class ServiceProviderTest extends BaseTestCase | ||
| { | ||
| protected function getPackageProviders($app) | ||
| { | ||
| return [ServiceProvider::class]; | ||
| } | ||
|
|
||
| public function testMigrationsCanBePublished() | ||
| { | ||
| // Test that the vendor:publish command can find the migration tag | ||
| $result = Artisan::call('vendor:publish', [ | ||
| '--tag' => 'laravel-scim-migrations', | ||
| '--provider' => ServiceProvider::class, | ||
| '--force' => true, | ||
| ]); | ||
|
|
||
| // The command should succeed (return 0) | ||
| $this->assertEquals(0, $result, 'Migrations should be publishable via vendor:publish command'); | ||
| } | ||
|
|
||
| public function testConfigCanBePublished() | ||
| { | ||
| // Test that the vendor:publish command can find the config tag | ||
| $result = Artisan::call('vendor:publish', [ | ||
| '--tag' => 'laravel-scim', | ||
| '--provider' => ServiceProvider::class, | ||
| '--force' => true, | ||
| ]); | ||
|
|
||
| // The command should succeed (return 0) | ||
| $this->assertEquals(0, $result, 'Config should be publishable via vendor:publish command'); | ||
| } | ||
|
|
||
| public function testMigrationFileExistsInPackage() | ||
| { | ||
| // Verify the migration file exists in the package | ||
| $migrationPath = realpath(__DIR__ . '/../database/migrations/2021_01_01_000003_add_scim_fields_to_users_table.php'); | ||
|
|
||
| $this->assertFileExists($migrationPath, 'Migration file should exist in the package'); | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Make sure to apply these when building/running the Docker image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the Dockerfile to publish the package migrations during the build process. The migration file that was manually created has been replaced with
php artisan vendor:publish --tag=laravel-scim-migrationswhich will publish the migration from the package. (commit 0d9e2fd)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot It seems that by removing the migration from the Dockerfile, the existing migration file does not introduce all required files (such as roles). Please check if something is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the
rolesfield to the migration. The package migration now includesformatted,active, androlesfields. Note:displayNamewas in the old Dockerfile migration but isn't actually used for Users in the SCIM schema (only for Groups), so it wasn't added. (commit a6da5ec)