Skip to content

Conversation

leonid-zats
Copy link

@leonid-zats leonid-zats commented Oct 9, 2025

User description

  • Remove Apollo-specific workflows:

    • canary-release.yml
    • prep-release.yml
    • release-bins.yml (complex multi-platform)
    • release-container.yml
    • sync-develop.yml
    • verify-changeset.yml
  • Keep ci.yml as main CI pipeline

  • Add simple release.yml for Ubuntu x86_64 builds only

  • Much simpler and more maintainable for independent org


Generated description

Below is a concise technical summary of the changes proposed in this PR:
Streamlines the CI/CD infrastructure for the Apollo GraphQL MCP server by removing complex, Apollo-specific multi-platform build and release workflows. This change migrates the project to a simplified, standard Rust/Cargo-based continuous integration pipeline and introduces a basic Ubuntu x86_64 release process, enhancing maintainability for independent organizations.

TopicDetails
Remove Legacy Workflows Removes a suite of legacy GitHub Actions workflows that managed complex Apollo-specific processes, including multi-platform builds, canary releases, pre-releases, container releases, development branch synchronization, and changeset verification. This significantly reduces the CI/CD overhead and simplifies the project's automation landscape.
Modified files (8)
  • .github/workflows/verify-changeset.yml
  • .github/workflows/test.yml
  • .github/workflows/sync-develop.yml
  • .github/workflows/release-container.yml
  • .github/workflows/release-bins.yml
  • .github/workflows/prep-release.yml
  • .github/workflows/canary-release.yml
  • .github/workflows/build.yml
Latest Contributors(2)
UserCommitDate
leonid-zatsRemove-problematic-cro...October 09, 2025
[email protected]update-HEAD-option-to-...September 12, 2025
Other Other files
Modified files (2)
  • crates/apollo-mcp-server/src/startup.rs
  • crates/apollo-mcp-server/src/config_manager.rs
Latest Contributors(1)
UserCommitDate
leonid-zatsAdd-comprehensive-test...October 09, 2025
Refactor TokenManager Tests Refactors the TokenManager implementation by moving test-specific helper methods into a #[cfg(test)] block within the main impl TokenManager definition, improving code organization and clarity for testability.
Modified files (1)
  • crates/apollo-mcp-server/src/token_manager.rs
Latest Contributors(1)
UserCommitDate
leonid-zatsAdd-comprehensive-test...October 09, 2025
Refactor CI/Release System Overhauls the continuous integration and release system by rewriting ci.yml to use standard Rust tooling (Cargo) instead of Nix for testing, checking, and building. A new release.yml is introduced to provide a simplified Ubuntu x86_64 binary release process. Accompanying changes in .cargo/config.toml and nix/apollo-mcp.nix remove previous cross-compilation configurations and force native builds, aligning the build environment with the new, simpler CI/CD strategy.
Modified files (4)
  • nix/apollo-mcp.nix
  • .github/workflows/release.yml
  • .github/workflows/ci.yml
  • .cargo/config.toml
Latest Contributors(2)
UserCommitDate
leonid-zatsRemove-problematic-cro...October 09, 2025
[email protected]Releasing-0.8.0-356September 16, 2025
This pull request is reviewed by Baz. Review like a pro on (Baz).

- Remove Apollo-specific workflows:
  - canary-release.yml
  - prep-release.yml
  - release-bins.yml (complex multi-platform)
  - release-container.yml
  - sync-develop.yml
  - verify-changeset.yml

- Keep ci.yml as main CI pipeline
- Add simple release.yml for Ubuntu x86_64 builds only
- Much simpler and more maintainable for independent org
- Add 'nix-collect-garbage -d' step to all CI jobs
- Forces rebuild of cached derivations with simplified configuration
- Resolves persistent linker errors from old cached cross-compilation setup
- Ensures fresh builds with current nix/apollo-mcp.nix configuration
- Run cargo fmt to fix formatting in:
  - config_manager.rs
  - startup.rs
  - token_manager.rs
- Resolves rustfmt check failures in CI
- Code now follows Rust formatting standards
…acts

- Override cargoCheckCommand to use 'cargo check --release --locked' instead of '--all-targets'
- The --all-targets flag was causing cargo to try cross-compilation
- This should resolve the 'x86_64-linux-gnu-gcc not found' error
- Use native toolchain to ensure native builds only
- Remove --locked from cargoCheckCommand override
- Crane library automatically adds --locked flag
- Resolves 'argument --locked cannot be used multiple times' error
- Keep only --release flag to avoid --all-targets cross-compilation
- Delete entire coverage job from ci.yml
- Remove cargo-llvm-cov installation and usage
- Remove codecov upload step
- Simplify CI to focus on core functionality only
- No more coverage dependencies or secrets required
- Change cargoClippyExtraArgs from '--all-targets -- --deny warnings' to '-- --deny warnings'
- Prevents clippy check from trying to cross-compile
- Resolves 'x86_64-linux-gnu-gcc not found' error in checks
- Ensures all checks use native builds only
- Add cargoExtraArgs = '' to cargoArtifacts build
- This should prevent crane from adding --all-targets automatically
- Combined with cargoCheckCommand override for maximum effect
- Resolves persistent cross-compilation linker errors
- Remove custom Rust toolchain override
- Use default crane.mkLib pkgs instead of overrideToolchain
- This should resolve stack smashing detected errors
- Default toolchain should be more stable and compatible
- Set cargoCheckCommand to 'cargo check --release --locked'
- Set cargoBuildCommand to 'cargo build --release --locked'
- Keep cargoExtraArgs = '' to prevent additional flags
- This should completely eliminate --all-targets from cargoArtifacts
- More aggressive approach to prevent cross-compilation
- Switch from craneLib.buildDepsOnly to craneLib.cargoBuild
- Use --workspace --exclude apollo-mcp-server to build only dependencies
- This should avoid crane's default --all-targets behavior
- Different approach to prevent cross-compilation issues
… builds

- Revert cargoArtifacts back to craneLib.buildDepsOnly craneCommonArgs
- Add CARGO_BUILD_TARGET = pkgs.stdenv.hostPlatform.config to force native builds
- Add CARGO_TARGET_DIR = 'target' to ensure consistent target directory
- This should prevent cross-compilation while keeping crane compatibility
- Fixes cargoClippy cargoArtifacts argument error
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
docs = craneLib.cargoDoc (craneCommonArgs
cargoClippyExtraArgs = "-- --deny warnings";
Copy link

Choose a reason for hiding this comment

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

Removing --all-targets from clippy means it won't check test code, examples, or benchmarks anymore. Was this intentional?

Suggested change
cargoClippyExtraArgs = "-- --deny warnings";
cargoClippyExtraArgs = "--all-targets -- --deny warnings";

Finding type: Logical Bugs

Copy link

Choose a reason for hiding this comment

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

Commit da307f0 addressed this comment by taking a different approach to the --all-targets issue. Instead of adding --all-targets back to clippy as suggested, the commit removes cargoArtifacts usage entirely and builds everything fresh to avoid the underlying issues that --all-targets was meant to solve, as evidenced by multiple comments in the code mentioning "avoid --all-targets issues".

- Add gcc-x86-64-linux-gnu and g++-x86-64-linux-gnu installation to all CI jobs
- This provides the missing x86_64-linux-gnu-gcc linker for cross-compilation
- Resolves 'x86_64-linux-gnu-gcc not found' errors on GitHub runners
- Allows crane's --all-targets to work properly with cross-compilation
- Use buildDepsOnly with cargoCheckCommand override instead of cargoBuild
- Set cargoCheckCommand = 'cargo check --release' to avoid --all-targets
- Set cargoExtraArgs = '' to prevent additional flags
- This should resolve cross-compilation issues while keeping dependency caching
- Replace buildDepsOnly with cargoCheck which doesn't add --all-targets by default
- cargoCheck only builds dependencies for the native target
- This should eliminate cross-compilation issues completely
- Simpler approach that avoids crane's hardcoded --all-targets behavior
- Comment out cargoArtifacts definition to avoid crane's --all-targets behavior
- Remove cargoArtifacts inheritance from clippy and docs checks
- Disable cache to force fresh builds
- This is a conservative approach that should eliminate the root cause
- Trade-off: slower builds but more predictable behavior
- cargoClippy requires cargoArtifacts as mandatory argument
- Use cargoBuild with multiple overrides to prevent --all-targets
- Set cargoCheckCommand = 'cargo check --release' to avoid --all-targets
- Set cargoExtraArgs = '' to prevent additional flags
- Restore cargoArtifacts inheritance and caching
- This should satisfy crane's requirements while avoiding cross-compilation
- Use buildDepsOnly with CARGO_BUILD_TARGET override
- Set CARGO_BUILD_TARGET to native platform config
- Add cargoCheckExtraArgs with explicit target specification
- This should force cargo to only build for native target
- Combined with installed cross-compilation toolchain should work
- Remove --release from cargoCheckExtraArgs since crane already adds it
- Keep only --target flag to specify native target
- This should resolve '--release cannot be used multiple times' error
- Command will now be: cargo check --release --locked --target x86_64-unknown-linux-gnu
- Add CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = 'gcc'
- Add CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CC = 'gcc'
- Add CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CXX = 'g++'
- This overrides the .cargo/config.toml cross-compilation settings
- Forces cargo to use native gcc instead of x86_64-linux-gnu-gcc
- Should resolve 'x86_64-linux-gnu-gcc not found' error
Comment on lines +65 to +67
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "gcc";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CC = "gcc";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CXX = "g++";
Copy link

Choose a reason for hiding this comment

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

The toolchain variables are hardcoded to X86_64_UNKNOWN_LINUX_GNU while CARGO_BUILD_TARGET uses dynamic pkgs.stdenv.hostPlatform.config. Should these match to avoid build failures on non-x86_64 platforms?

Suggested change
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "gcc";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CC = "gcc";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CXX = "g++";
# Override linker to use native gcc instead of cross-compilation linker
CARGO_TARGET_${lib.toUpper (lib.replaceStrings ["-"] ["_"] pkgs.stdenv.hostPlatform.config)}_LINKER = "gcc";
CARGO_TARGET_${lib.toUpper (lib.replaceStrings ["-"] ["_"] pkgs.stdenv.hostPlatform.config)}_CC = "gcc";
CARGO_TARGET_${lib.toUpper (lib.replaceStrings ["-"] ["_"] pkgs.stdenv.hostPlatform.config)}_CXX = "g++";

Finding type: Logical Bugs

- Remove complex Nix-based CI with cache/check/build/test jobs
- Replace with simple Cargo workflow: test, check, build
- Uses standard Rust toolchain and cargo commands
- Caches cargo registry, index, and build artifacts
- Remove cross-compilation linker configuration from .cargo/config.toml
- Much simpler and more maintainable
- No more Nix build errors or cross-compilation issues
- Move #[cfg(test)] impl TokenManager inside mod tests block
- Resolves 'items after a test module' clippy error
- Test helper methods are now properly scoped within tests module
CI Improvements:
- Add matrix strategy to test on both Ubuntu and macOS
- Build artifacts for both Linux (x86_64) and macOS (aarch64)
- Proper artifact naming per platform
- All tests run on both platforms

Release Improvements:
- Build for both Linux and macOS in parallel
- Create separate artifacts for each platform
- Handle different sha256sum commands (Linux vs macOS)
- Download all artifacts and upload to release
- Proper multi-platform release packaging

Benefits:
- Ensures code works on both Linux and macOS
- Provides native binaries for both platforms
- Faster parallel builds
- Better platform coverage
- CI now only runs on Ubuntu (faster, cheaper)
- macOS builds still included in release workflow
- Reduces GitHub Actions costs (~10x cheaper)
- CI runs on every PR/push, releases are infrequent
@leonid-zats leonid-zats merged commit 4e731ca into main Oct 12, 2025
3 checks passed
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.

1 participant