Skip to content

fix(storage): replace retired azure-storage-blob with maintained azure-blob - #7108

Open
tacoda wants to merge 2 commits into
rubyforgood:mainfrom
tacoda:issue-7094
Open

fix(storage): replace retired azure-storage-blob with maintained azure-blob#7108
tacoda wants to merge 2 commits into
rubyforgood:mainfrom
tacoda:issue-7094

Conversation

@tacoda

@tacoda tacoda commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

What github issue is this PR for, if any?

Resolves #7094

What changed, and why?

The azure-storage-blob / azure-storage-common gems were retired by Microsoft on 13 Sep 2024 and are unmaintained. They also forced a manual cgi ~> 0.5.1 pin under Ruby 4.0 (azure-storage-common needs CGI.parse, which Ruby 4.0's stripped stdlib omits and Rails 8 no longer pulls in transitively).

Swap to testdouble/azure-blob, a maintained drop-in Active Storage adapter:

  • Gemfile: azure-storage-blob -> azure-blob; drop the now-redundant cgi pin (azure-blob declares cgi as a dependency, so the full library resolves again).
  • config/storage.yml: microsoft service AzureStorage -> AzureBlob.
  • Rewrite the signing regression guard to exercise the AzureBlob Active Storage service (offline URL signing for download + direct upload), replacing the old azure-storage-common internal-class assertions.

Same Azure account / container / keys, so no data migration or infra change.

How is this tested? (please write rspec and jest tests!) 💖💪

Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system

One file touched: spec/lib/azure_storage_signing_spec.rb (rewritten). Dropped tests coupled to methods that are gone with azure-storage-blob. Same intent, re-pointed at the real Active Storage adapter. Builds ActiveStorage::Service::AzureBlobService with dummy credentials.

  • It has the full CGI library, not Ruby 4.0's escape-only stdlib.
  • It signs a private download URL locally, without hitting Azure.
  • It signs a direct-upload URL locally, without hitting Azure.
  • Offline: signing is pure-local (SharedKey), no network/live Azure. Runs in CI.
  • Higher-level than before: tests the Active Storage service contract, not gem internals → survives future gem/Ruby bumps.
  • Result: 3 examples, 0 failures.

Gap (unchanged, flagged earlier)

Still no real round-trip test (upload→store→download against live Azure). This path needs credentials. Covered only by staging smoke-test before merge. App test env uses Disk storage, so the Azure path is exercised nowhere else. That blind spot is exactly why #7093 stayed green.

Needs to go through integration testing through a real Heroku environment to verify a connection to the real Azure account in an environment that is production-like.

Screenshots please :)

Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.

N/A - Backend only change

Feelings gif (optional)

What gif best describes your feeling working on this issue?
Indiana Jones

…e-blob

The azure-storage-blob / azure-storage-common gems were retired by Microsoft
on 13 Sep 2024 and are unmaintained. They also forced a manual `cgi ~> 0.5.1`
pin under Ruby 4.0 (azure-storage-common needs CGI.parse, which Ruby 4.0's
stripped stdlib omits and Rails 8 no longer pulls in transitively).

Swap to testdouble/azure-blob, a maintained drop-in Active Storage adapter:

- Gemfile: azure-storage-blob -> azure-blob; drop the now-redundant cgi pin
  (azure-blob declares cgi as a dependency, so the full library resolves again).
- config/storage.yml: microsoft service AzureStorage -> AzureBlob.
- Rewrite the signing regression guard to exercise the AzureBlob Active Storage
  service (offline URL signing for download + direct upload), replacing the old
  azure-storage-common internal-class assertions.

Same Azure account / container / keys, so no data migration or infra change.

Closes rubyforgood#7094
@github-actions github-actions Bot added 🧪 Tests Tests dependencies Touches dependency files ruby Touches Ruby code labels Aug 8, 2026
Brakeman 7.1.2's EOLRails check now fires (Rails 8.0.5.1 support ends
2026-10-07, within its warning window), failing the security workflow.
Rails upgrade is tracked separately and out of scope for the Azure adapter
change, so add the warning to config/brakeman.ignore with a note.
@tacoda tacoda self-assigned this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Touches dependency files ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[important!] Rewrite/update Azure integration

1 participant