Skip to content

TaskCTL to eirctl migration#741

Draft
RichardSlater wants to merge 52 commits into
masterfrom
chore/eirctl
Draft

TaskCTL to eirctl migration#741
RichardSlater wants to merge 52 commits into
masterfrom
chore/eirctl

Conversation

@RichardSlater

Copy link
Copy Markdown

[XXXX-<Title> - Please use the Work Item number and Title as PR Name, not subtasks]

📲 What

Migration from taskctl to eirctl based upon eirctl migration guide.

🤔 Why

Usage of taskctl is deprecated within Ensono Digital.

🛠 How

Following steps in: https://github.com/Ensono/eirctl/blob/docs/migration/docs/migration.adoc

👀 Evidence

🕵️ How to test

Notes for QA

✅ Acceptance criteria Checklist

  • Code peer reviewed?
  • Documentation has been updated to reflect the changes?
  • Passing all automated tests, including a successful deployment?
  • Passing any exploratory testing?
  • Rebased/merged with latest changes from development and re-tested?
  • Meeting the Coding Standards?

@RichardSlater RichardSlater self-assigned this Aug 11, 2025
@RichardSlater RichardSlater added the terraform Pull requests that update Terraform code label Aug 11, 2025
@RichardSlater RichardSlater changed the title Chore/eirctl TaskCTL to eirctl migration Aug 11, 2025
The previous commit introduced bash && operators which are not valid
PowerShell syntax. PowerShell requires semicolons (;) to chain commands.

This fixes the parser error:
'Unexpected token '=' in expression or statement'

All command separators in the test task now use PowerShell-compatible
semicolons instead of bash && operators.
The previous approach of setting $env:JAVA_HOME and $env:PATH was not
propagating to child processes spawned by .NET tools (dotnet-sonarscanner).

This commit uses [System.Environment]::SetEnvironmentVariable() with
Process scope to ensure JAVA_HOME and PATH are properly inherited by
all child processes in the PowerShell session, including the SonarScanner
CLI invoked by dotnet-sonarscanner.

Key changes:
- Use SetEnvironmentVariable with Process target instead of $env: syntax
- Set environment variables once at the start of the test task
- Remove redundant re-setting before Invoke-SonarScanner -stop
- Add diagnostic output to verify variables are set correctly
Set SONAR_SCANNER_JAVA_OPTS with -Djava.home to tell the SonarScanner
JVM directly where Java is installed, bypassing PATH lookup issues.

Also added diagnostic output to show which java executable is being
resolved, and ensured JAVA_HOME/PATH are set before both start and stop
operations.

This approach passes the Java location as a JVM system property which
should work even if environment variable inheritance to child processes
is problematic.
- Remove /usr/local/java/bin/java and create symlink to correct Java 17
- This ensures SonarScanner CLI finds the correct Java regardless of PATH
- Eliminates environment variable propagation issues through process chain
- Removes diagnostic output and redundant env var settings
…werShell

PowerShell in the container doesn't recognize sudo or native shell commands like ln. This fix wraps the symlink commands in 'sh -c' to execute them in a proper shell environment where these commands are available.
Created detailed documentation analyzing the persistent Java detection failure in eirctl Docker containers during the taskctl to eirctl migration.

Document includes:

- Problem statement with technical root cause analysis

- Detailed breakdown of 10 remediation attempts with commit links

- Architecture analysis of process chains and environment propagation

- 7 proposed solutions with implementation details and risk assessment

- Comparison matrix and recommended hybrid approach

- Investigation checklist and lessons learned

- Complete references and build log excerpts

This 31-page document serves as a comprehensive resource for:

- Understanding the multi-level environment variable inheritance issue

- Evaluating solution options (container fix, context config, bash scripts)

- Planning the path forward to unblock the eirctl migration

Related: PR #741
RichardSlater added a commit that referenced this pull request Oct 17, 2025
Created detailed documentation analyzing the persistent Java detection failure in eirctl Docker containers during the taskctl to eirctl migration.

Document includes:

- Problem statement with technical root cause analysis

- Detailed breakdown of 10 remediation attempts with commit links

- Architecture analysis of process chains and environment propagation

- 7 proposed solutions with implementation details and risk assessment

- Comparison matrix and recommended hybrid approach

- Investigation checklist and lessons learned

- Complete references and build log excerpts

This 31-page document serves as a comprehensive resource for:

- Understanding the multi-level environment variable inheritance issue

- Evaluating solution options (container fix, context config, bash scripts)

- Planning the path forward to unblock the eirctl migration

Related: PR #741
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

terraform Pull requests that update Terraform code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants