Fix Oracle initialization script handling - #19601
Fix Oracle initialization script handling#19601Sébastien Ros (sebastienros) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2d04c45e-ad3f-4bba-9057-ac1d3fea5538
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19601Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19601" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Fixes Oracle container initialization behavior in the container-backed hosting integration.
Changes:
- Targets startup scripts at Oracle’s expected directory.
- Generates Oracle-compatible passwords.
- Adds setup/startup tests and usage guidance.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
OracleDatabaseBuilderExtensions.cs |
Updates script path, password generation, and documentation. |
README.md |
Documents startup and setup script usage. |
AddOracleTests.cs |
Adds app-model and password regression tests. |
OracleFunctionalTests.cs |
Separates real-container initialization scenarios. |
| .withInitFiles("./oracle/startup"); | ||
| ``` | ||
|
|
||
| Use `WithDbSetupBindMount` for scripts that should run once while Oracle creates the database. Oracle Database Free images include a pre-built database, so setup scripts run only when the container starts with empty data storage. Configure a new data volume or an empty data bind mount together with the setup scripts: |
| await app.StartAsync(); | ||
|
|
||
| await app.WaitForTextAsync(DatabaseReadyText, cancellationToken: cts.Token); | ||
| await app.WaitForTextAsync("DONE: Executing user defined scripts", cancellationToken: cts.Token); |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2d04c45e-ad3f-4bba-9057-ac1d3fea5538
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. 1 / 102 test projects · 2 jobs, from 3 changed files. Selected test projects (1 / 102)
Selected jobs (2)
How these were chosen — grouped by what changed🔧 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
src/Aspire.Hosting.Oracle/README.md:57
- Changing the fallback generator does not repair passwords already persisted by an earlier run:
GetParameterValueprefersParameters:{name}-passwordfrom configuration over the new default. An existing app that previously generated an unsupported special character can therefore still fail when it switches to empty storage. Add migration guidance to remove or replace that persisted value with an alphanumeric password before fresh-database creation.
Use `WithDbSetupBindMount` for scripts that should run once while Oracle creates the database. Oracle Database Free images include a pre-built database, so setup scripts run only when the container starts with empty data storage. Configure a new data volume or an empty data bind mount together with the setup scripts:
| /// <remarks> | ||
| /// Oracle executes scripts in the startup scripts directory each time the database container starts. | ||
| /// </remarks> |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Description
Oracle Database Free ships with a pre-built database, so setup scripts do not run unless empty data storage triggers database creation. In addition,
WithInitFilescopied flat scripts to Oracle's parent scripts directory instead of the startup directory, and generated passwords could contain characters rejected by fresh-database creation.This change:
WithInitFilescontent to/opt/oracle/scripts/startupwhile preserving existing parent directories containing Oracle'sstartup/orsetup/layout.WithDbSetupBindMountmount-only while documenting that it must be paired with empty data storage for Oracle Free.User-facing usage
C# AppHost:
TypeScript AppHost:
Validation included 48 targeted unit/API tests, both supported
WithInitFileslayouts against a real Oracle container, and the fresh-database setup scenario.Fixes: #5190
Checklist
<remarks />and<code />elements on your triple slash comments?