Skip to content

feat: add contributor CI workflow for fork-friendly testing#192

Open
abtreece wants to merge 1 commit into
fullstaq-ruby:mainfrom
abtreece:feat/contributor-ci
Open

feat: add contributor CI workflow for fork-friendly testing#192
abtreece wants to merge 1 commit into
fullstaq-ruby:mainfrom
abtreece:feat/contributor-ci

Conversation

@abtreece
Copy link
Copy Markdown
Collaborator

Summary

Adds a credentialless CI workflow that runs on contributor forks and PRs, enabling third-party contributors to validate their changes without access to project infrastructure.

  • Contributor CI workflow (ci-cd-contributor): Builds Ruby packages for two representative distributions (Ubuntu 24.04 and EL 9) with applicable variants and runs smoke tests. No cloud credentials or special setup needed.
  • ok-to-test label gate: Maintainers can add the ok-to-test label to trigger the full CI pipeline (all distros, test publishing) against a PR. A label guard workflow automatically removes the label when new commits are pushed, requiring re-review before re-triggering.
  • Main workflow restriction: The main CI/CD workflow now checks github.repository to avoid running on forks.
  • Variant exclusion support: Contributor workflow respects variant_exclusions from config.yml (e.g., skips malloctrim for Ruby >= 3.3).
  • Test script fixes: createrepocreaterepo_c in RPM test prep, added adduser package for DEB tests.
  • Documentation: Updated CONTRIBUTING.md with fork CI and local build/test instructions.

Closes #54

Test plan

  • Verify contributor CI workflow runs on a fork push (no secrets required)
  • Verify ok-to-test label triggers full pipeline on PR
  • Verify label guard removes ok-to-test on new push to PR
  • Verify main CI workflow does not run on fork repositories
  • Verify generated YAML matches ERB template output (./internal-scripts/generate-ci-cd-yaml.rb)
  • Verify malloctrim variant is excluded for Ruby >= 3.3 in contributor workflow

Add a credentialless CI workflow that runs on contributor forks and PRs,
enabling third-party contributors to validate their changes without
access to project infrastructure.

- Contributor CI workflow (ci-cd-contributor) builds Ruby packages for
  two representative distributions (Ubuntu 24.04 and EL 9) with
  applicable variants and runs smoke tests
- ok-to-test label gate lets maintainers trigger the full CI pipeline;
  a label guard workflow removes the label on new pushes, requiring
  re-review before re-triggering
- Main CI/CD workflow restricted to upstream repository only
- Respects variant_exclusions from config.yml (skips malloctrim for
  Ruby >= 3.3)
- Test script fixes: createrepo -> createrepo_c, added adduser package
- Updated CONTRIBUTING.md with fork CI and local build/test docs
@abtreece abtreece force-pushed the feat/contributor-ci branch from b39e09f to c5c0ec4 Compare April 25, 2026 04:35
Copy link
Copy Markdown
Collaborator

@noahssarcastic noahssarcastic left a comment

Choose a reason for hiding this comment

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

Looks good, reviewed with respect to pull_request and pull_request_target and all actions are safe from "pwn request" PR's. Added a couple of nitpick type things, we may want to call out the use of pull_request and pull_request_target and other guard-rails in comment to ensure they are not accidentally removed or modified.

end

def latest_ruby_package_version
ruby_package_versions.first
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is not explicitly enforced in the config, we could add a sort function on the list to enforce, or at least leave a comment in the config file stating that we expect this ordering.

@contributor_distributions ||= begin
names = config[:contributor_distributions]
return [] if names.nil?
names.map do |name|
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggest refactoring this mapping code and the instance above to a single helper function to prevent drift in case the object structure changes.

@@ -0,0 +1,34 @@
name: 'CI/CD: label guard'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

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.

Allow third-party pull requests to use the CI system

2 participants