Skip to content

Conversation

@kbukum1
Copy link
Contributor

@kbukum1 kbukum1 commented Dec 23, 2025

What

Fixes #11760 - Migrate Hex integration tests from external self-hosted registry to team-controlled Hex.pm organization.

Why

The integration specs relied on dependabot-private.fly.dev, an external self-hosted registry that was frequently unavailable (503 errors), requiring complex mocking workarounds and causing flaky tests.

This PR migrates to our Hex.pm organization infrastructure for more reliable testing.

Approach: Real integration tests for hex_organization credentials (Hex.pm hosted), mocked tests for hex_repository credentials (self-hosted registries).

How

  • Credential migration: Changed from hex_repository to hex_organization credential type
  • Test fixtures: Updated to use test packages from dependabot organization on Hex.pm
  • Skip logic: Tests gracefully skip without token, following Composer pattern
  • CI integration: Added HEX_PM_ORGANIZATION_TOKEN environment variable to workflow
  • Documentation: Created setup guide for contributors

Key Changes

  • Integration specs - Migrated to hex_organization credentials with graceful skip logic
  • Test fixtures - Updated to use dependabot organization packages and lockfile format
  • CI workflow - Added HEX_PM_ORGANIZATION_TOKEN environment variable
  • Documentation - New contributor setup guide

Testing

With token (CI after secret configured):

bin/docker-dev-shell hex
rspec spec/dependabot/hex/file_updater/lockfile_updater_spec.rb:440
rspec spec/dependabot/hex/update_checker_spec.rb:467

Without token (tests skip gracefully):

unset HEX_PM_ORGANIZATION_TOKEN
rspec spec/dependabot/hex/update_checker_spec.rb:437
# Output: "skipped because env var HEX_PM_ORGANIZATION_TOKEN is not set"

@github-actions github-actions bot added the L: elixir:hex Elixir packages via hex label Dec 23, 2025
@kbukum1 kbukum1 changed the title Add HEX PM organization token support for CI and update specs Add HEX PM organization token support Pivate Registry on CI and update specs Dec 23, 2025
@kbukum1 kbukum1 force-pushed the kamil/add-hex-pm-as-registry-for-ci branch 3 times, most recently from 855dca8 to 54a7878 Compare December 24, 2025 21:12
…updater tests for private organization dependencies
@kbukum1 kbukum1 force-pushed the kamil/add-hex-pm-as-registry-for-ci branch from 7325a0f to 7033ea6 Compare December 29, 2025 15:26
@kbukum1 kbukum1 marked this pull request as ready for review December 29, 2025 19:32
@kbukum1 kbukum1 requested a review from a team as a code owner December 29, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: elixir:hex Elixir packages via hex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants