Skip to content

Enable anonymous access in Nexus configuration script#4387

Merged
RonShakutai merged 58 commits into
mainfrom
nexus-bug-fix-4361
Mar 15, 2025
Merged

Enable anonymous access in Nexus configuration script#4387
RonShakutai merged 58 commits into
mainfrom
nexus-bug-fix-4361

Conversation

@RonShakutai

@RonShakutai RonShakutai commented Feb 20, 2025

Copy link
Copy Markdown
Collaborator

Resolves #4361

Summary

This pull request refactors the Nexus configuration script to handle delays more gracefully and enables anonymous access once Nexus is confirmed to be ready.

What Is Being Addressed

  • Previously, the script tried to configure Nexus before it was fully ready, causing intermittent failures.
  • Anonymous access was not enabled in the original script.

How It Is Addressed

  1. Exponential retry added
  2. Wait for Configuration Directory Implemented
  3. Wait for Nexus Service
  4. Enable Anonymous Access
  5. added configure_repo function

Evidence of service availability delay:
image

Tests

@github-actions

github-actions Bot commented Feb 20, 2025

Copy link
Copy Markdown

Unit Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 3e7ca1b.

♻️ This comment has been updated with latest results.

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/13480801966 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/13495247766 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/13496805569 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/13502255618 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/13515419105 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13518766607 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13519314802 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/destroy-env

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

/destroy-env is not recognised as a valid command.

You can use the following commands:
    /test - build, deploy and run smoke tests on a PR
    /test-extended - build, deploy and run smoke & extended tests on a PR
    /test-extended-aad - build, deploy and run smoke & extended AAD tests on a PR
    /test-shared-services - test the deployment of shared services on a PR build
    /test-force-approve - force approval of the PR tests (i.e. skip the deployment checks)
    /test-destroy-env - delete the validation environment for a PR (e.g. to enable testing a deployment from a clean start after previous tests)
    /help - show this help

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-destroy-env

@github-actions

Copy link
Copy Markdown

Destroying branch test environment (RG: rg-tredcf4d668)... (run: https://github.com/microsoft/AzureTRE/actions/runs/13519412407)

@github-actions

Copy link
Copy Markdown

Destroying PR test environment (RG: rg-tre6a231665)... (run: https://github.com/microsoft/AzureTRE/actions/runs/13519412407)

@github-actions

Copy link
Copy Markdown

Branch test environment destroy complete (RG: rg-tredcf4d668)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13519447452 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@github-actions

Copy link
Copy Markdown

PR test environment destroy complete (RG: rg-tre6a231665)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@RonShakutai RonShakutai marked this pull request as ready for review March 12, 2025 16:24
@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/13816781272 (with refid 6a231665)

(in response to this comment from @ShakutaiGit)

@marrobi marrobi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marrobi marrobi requested review from Copilot and jonnyry March 12, 2025 17:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Nexus configuration script to handle delayed service readiness and enable anonymous access once Nexus is available. Key changes include:

  • Adding an exponential retry mechanism for handling Nexus availability delays.
  • Enabling anonymous access in the Nexus configuration.
  • Bumping the Nexus image version in the porter.yaml file.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
CHANGELOG.md Updated changelog to document anonymous access enablement and the retry mechanism for Nexus.
templates/shared_services/sonatype-nexus-vm/porter.yaml Updated the Nexus version from 3.3.2 to 3.3.3 to reflect the changes in the Nexus configuration.

Comment thread CHANGELOG.md
@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-force-approve

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

✅ Marking tests as complete (for commit a172957)

(in response to this comment from @ShakutaiGit)

@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-destroy-env

@github-actions

Copy link
Copy Markdown

Destroying PR test environment (RG: rg-tre6a231665)... (run: https://github.com/microsoft/AzureTRE/actions/runs/13821239944)

@github-actions

Copy link
Copy Markdown

Destroying branch test environment (RG: rg-tredcf4d668)... (run: https://github.com/microsoft/AzureTRE/actions/runs/13821239944)

@github-actions

Copy link
Copy Markdown

Branch test environment destroy complete (RG: rg-tredcf4d668)

@github-actions

Copy link
Copy Markdown

PR test environment destroy complete (RG: rg-tre6a231665)

Comment thread templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh Outdated
@RonShakutai

Copy link
Copy Markdown
Collaborator Author

/test-force-approve

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

✅ Marking tests as complete (for commit 3e7ca1b)

(in response to this comment from @ShakutaiGit)

@RonShakutai RonShakutai merged commit 0248bcf into main Mar 15, 2025
@RonShakutai RonShakutai deleted the nexus-bug-fix-4361 branch March 15, 2025 20:45
marrobi pushed a commit to marrobi/AzureTRE that referenced this pull request May 20, 2025
* Enable anonymous access in Nexus configuration script

* Add role assignment for Storage Account Contributor in bootstrap script

* Enhance role assignment check in bootstrap script to verify both "Storage Blob Data Contributor" and "Storage Account Contributor" roles are assigned

* Refactor role assignment check to validate both "Storage Blob Data Contributor" and "Storage Account Contributor" roles

* Remove unused script source from bootstrap.sh

* Refactor role assignment check to use local variables for clarity

* Update CHANGELOG and add role assignment for Storage Account Contributor in bootstrap.sh

* Refactor role assignment check to use counts for validation and streamline script execution

* Refactor role assignment check to use non-empty value validation and enhance storage container creation with retry logic

* revert bootstrap

* CR changes

* Refactor role assignment check to verify access via storage container list

* Implement retry logic for role assignment checks in bootstrap script

* Refactor check_terraform_role_assignments function to simplify error handling and remove unnecessary output

* Enhance error message in check_terraform_role_assignments function to indicate retry mechanism on unexpected output

* Remove unnecessary echo statement from retry_with_backoff function in bootstrap script

* Add validation for required environment variables in bootstrap script

* Refactor bootstrap script to streamline Terraform initialization and backend configuration

* Add shellcheck disable comments for unbound variable warnings in bootstrap script

* Update terraform_wrapper invocation and add blank line for readability in bootstrap script

* Bump version to 0.12.7 in version.txt

* Refactor bootstrap script to move backend configuration inline and remove redundant function

* Remove redundant function call for writing bootstrap Terraform backend

* Update show_output.sh to use current directory and improve terraform_wrapper.sh usage documentation

* Remove TODO comments from Terraform command output in bootstrap script

* Bump version to 0.12.8 in version.txt

* Bump version to 0.12.7

* Bump version to 0.12.7 in version.txt

* Fix: simplify anonymous access configuration in Nexus repository script

* Refactor bootstrap script to inline backend configuration and improve error handling

* fix: update condition for Azure and ACR login to check for 'make bootstrap'

* fix: resolve CI issue with Azure login steps for branches containing 'bootstrap'

* refactor: move Terraform backend configuration to a dedicated section in bootstrap.sh

* fix: update role assignment to use Storage Blob Data Contributor in bootstrap.sh

* fix: refine role assignment query in bootstrap.sh to check only for Storage Blob Data Contributor

* fix: update role check in bootstrap.sh to return status instead of echoing

* fix: update comment for granting Storage Blob Data Contributor role in bootstrap.sh

* fix: update comment for granting Storage Blob Data Contributor permissions in bootstrap.sh

* fix: update Sonatype Nexus version and enhance repository configuration script with retry logic

* fix: downgrade Sonatype Nexus version from 3.3.5 to 3.3.3 in porter.yaml

* chore: update CHANGELOG.md to include enhancements and bug fixes for Nexus access and retry logic

* fix: remove VS Code extensions proxy configuration from Nexus setup script

* fix: update comment formatting in bootstrap.sh for clarity

* refactor: rename functions for clarity in configure_nexus_repos.sh
martinpeck pushed a commit that referenced this pull request May 20, 2025
* Enable anonymous access in Nexus configuration script

* Add role assignment for Storage Account Contributor in bootstrap script

* Enhance role assignment check in bootstrap script to verify both "Storage Blob Data Contributor" and "Storage Account Contributor" roles are assigned

* Refactor role assignment check to validate both "Storage Blob Data Contributor" and "Storage Account Contributor" roles

* Remove unused script source from bootstrap.sh

* Refactor role assignment check to use local variables for clarity

* Update CHANGELOG and add role assignment for Storage Account Contributor in bootstrap.sh

* Refactor role assignment check to use counts for validation and streamline script execution

* Refactor role assignment check to use non-empty value validation and enhance storage container creation with retry logic

* revert bootstrap

* CR changes

* Refactor role assignment check to verify access via storage container list

* Implement retry logic for role assignment checks in bootstrap script

* Refactor check_terraform_role_assignments function to simplify error handling and remove unnecessary output

* Enhance error message in check_terraform_role_assignments function to indicate retry mechanism on unexpected output

* Remove unnecessary echo statement from retry_with_backoff function in bootstrap script

* Add validation for required environment variables in bootstrap script

* Refactor bootstrap script to streamline Terraform initialization and backend configuration

* Add shellcheck disable comments for unbound variable warnings in bootstrap script

* Update terraform_wrapper invocation and add blank line for readability in bootstrap script

* Bump version to 0.12.7 in version.txt

* Refactor bootstrap script to move backend configuration inline and remove redundant function

* Remove redundant function call for writing bootstrap Terraform backend

* Update show_output.sh to use current directory and improve terraform_wrapper.sh usage documentation

* Remove TODO comments from Terraform command output in bootstrap script

* Bump version to 0.12.8 in version.txt

* Bump version to 0.12.7

* Bump version to 0.12.7 in version.txt

* Fix: simplify anonymous access configuration in Nexus repository script

* Refactor bootstrap script to inline backend configuration and improve error handling

* fix: update condition for Azure and ACR login to check for 'make bootstrap'

* fix: resolve CI issue with Azure login steps for branches containing 'bootstrap'

* refactor: move Terraform backend configuration to a dedicated section in bootstrap.sh

* fix: update role assignment to use Storage Blob Data Contributor in bootstrap.sh

* fix: refine role assignment query in bootstrap.sh to check only for Storage Blob Data Contributor

* fix: update role check in bootstrap.sh to return status instead of echoing

* fix: update comment for granting Storage Blob Data Contributor role in bootstrap.sh

* fix: update comment for granting Storage Blob Data Contributor permissions in bootstrap.sh

* fix: update Sonatype Nexus version and enhance repository configuration script with retry logic

* fix: downgrade Sonatype Nexus version from 3.3.5 to 3.3.3 in porter.yaml

* chore: update CHANGELOG.md to include enhancements and bug fixes for Nexus access and retry logic

* fix: remove VS Code extensions proxy configuration from Nexus setup script

* fix: update comment formatting in bootstrap.sh for clarity

* refactor: rename functions for clarity in configure_nexus_repos.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with anonymous access in nexus

4 participants