Skip to content

Move composites into stacks-core and refactor workflows#7166

Open
wileyj wants to merge 32 commits intostacks-network:developfrom
wileyj:chore/move_external_composites
Open

Move composites into stacks-core and refactor workflows#7166
wileyj wants to merge 32 commits intostacks-network:developfrom
wileyj:chore/move_external_composites

Conversation

@wileyj
Copy link
Copy Markdown
Collaborator

@wileyj wileyj commented Apr 23, 2026

Apologies for the large PR 😭 .
The diff is big but it's mostly moving things around, copying over external composite actions and tightening up how scripts and workflows are formatted/used.

The main changes here:

  • updated all external composites to use recent version (will perform another pass to ensure we're up to date. i think nix-check is still on nodejs20 and will need an update before this may merge)
  • moved all used composites from stacks-network/actions into the ./github/actions/ folder
  • moved all scripts and created new scripts to be called by workflows in .github/scripts folder
  • release notes now are auto generated via template file in ./github/actions/release/create-github/release/release.template (and populated from ./gjtub/scripts/draft_release.sh). it follows the same form we've been using, but automates it pretty close to what we will want to publish.
  • removed ./net-test folder and other unused legacy files where i found them

in addiitional to many minor changes:

  • default permissions for all workflow are intentionally set to contents:read, and elevated where needed.
  • set default permissions for all scripts at 0644 so they are not executable (all should be run intentionally)
  • concurrency is updated to ensure cancelling a job will cancell all downstream jobs
  • use outputs as opposed to env vars for passing variables between steps/jobs
  • scripts are runnable locally (some do require env vars being set manually on the command line, but they will work nearly identically to a runner)
    • scripts are uniform in output by using a logging.sh script - no more echo "something", we may now use `info "something"; error "something broke"
  • since we're utilizing local composites and scripts, it does require more checkouts, but we can use a sparse checkout for .github to call the scripts/composites.
  • all test workflows are run able to run manually and will create the caches needed if they don't exist (compared to the removed standalone-test workflow). on a PR, these steps are skipped
  • more standarized formatting so the workflows follow the same pattern. human readable is the goal vs dense text.

some sample workflow runs:

  1. manual trigger (with caches already existing): https://github.com/wileyj/stacks-core/actions/runs/24705323620
  2. manual trigger with cache built: https://github.com/wileyj/stacks-core/actions/runs/24706032973
  3. PR trigger: https://github.com/wileyj/stacks-core/actions/runs/24730874928
  4. Commit to an open PR: https://github.com/wileyj/stacks-core/actions/runs/24743694825?pr=264
  5. release builds:

@wileyj wileyj closed this Apr 23, 2026
@wileyj wileyj reopened this Apr 23, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 23, 2026

Coverage Report for CI Build 25584487095

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.1%) to 85.6%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 3263 coverage regressions across 86 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

3263 previously-covered lines in 86 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
stackslib/src/chainstate/stacks/db/transactions.rs 208 97.07%
stackslib/src/net/inv/epoch2x.rs 208 80.24%
stackslib/src/net/chat.rs 201 93.01%
stackslib/src/chainstate/stacks/miner.rs 196 83.16%
stacks-node/src/nakamoto_node/miner.rs 149 87.34%
stackslib/src/chainstate/stacks/db/mod.rs 135 86.21%
clarity/src/vm/costs/mod.rs 125 83.57%
stackslib/src/net/api/postblock_proposal.rs 125 80.14%
stacks-node/src/nakamoto_node/relayer.rs 107 86.64%
stackslib/src/config/mod.rs 101 68.84%

Coverage Stats

Coverage Status
Relevant Lines: 218521
Covered Lines: 187053
Line Coverage: 85.6%
Coverage Strength: 16603804.77 hits per line

💛 - Coveralls

Comment thread .github/workflows/release-docker.yml Outdated
Comment thread .github/workflows/release-docker.yml Outdated
Comment thread .github/workflows/release-docker.yml Outdated
Comment thread .github/scripts/check_jobs_status.sh Outdated
Comment thread .github/scripts/bitcoin_tests.sh Outdated
Comment thread .github/scripts/check_release.sh Outdated
Comment thread .github/scripts/bitcoin_tests.sh Outdated
Comment thread .github/scripts/build_binaries.sh Outdated
Comment thread .github/scripts/logging.sh Outdated
Comment on lines +12 to +15
info() { echo "${COLGREEN}INFO:${COLRESET} $*"; }
warn() { echo "${COLYELLOW}WARN:${COLRESET} $*"; }
error() { echo "${COLRED}ERROR:${COLRESET} $*" >&2; [[ -n "${GITHUB_STEP_SUMMARY:-}" ]] && echo "**ERROR:** $(strip_ansi "$*")" >> "${GITHUB_STEP_SUMMARY}"; }
hl() { printf '%s' "${COLYELLOW}$*${COLRESET}"; } # highlight an inline value
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.

maybe we could redirect all the logging to stderr just in case we need sh scripts to return some value on the stdout

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I can see the appeal of that, and i don't have any concerns.
would you rather this was done in this PR or a followup? there are still several things i want to address in a later PR, but felt it was better to open what i have now since it's functioning the way i want (minus a few bugs you have already noted here).

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.

I don’t have a strong preference either way. I'm fine with addressing it in this PR or as a follow-up, whatever you think fits best with your current scope.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Sanity check on this commit: all logs are now being written to the run’s Step Summary. Should we limit this behavior to error logs only? Otherwise, there’s a risk of cluttering the Step Summary with too much information.

Comment thread .github/scripts/check_release.sh
Comment on lines +41 to +43
if: >-
github.repository == 'stacks-network/stacks-core' &&
(inputs.node_tag != '' || inputs.signer_tag != '')
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this is a footgun and needs to be fixed.

with this in place, no fork can run the release workflows which is not the desired outcome. will have to find a different way to resolve this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines +98 to +108
printf '%s' "${cargo_output}" \
| sed $'s/\033\\[[0-9;]*[A-Za-z]//g' \
| sed $'s/\033.[A-G]//g' \
| tr "\n" "\r" \
| sed -E 's#Diff in ([^\r]*?) at line ([[:digit:]]+):\r((:?[ +-][^\r]*\r)+)#<details>\n<summary>\1:\2</summary>\n\n```diff\n\3```\n\n</details>\n\n#g' \
| tr "\r" "\n" >> "${GITHUB_STEP_SUMMARY}"
fi
fi

# Print the original cargo output to the terminal in case of fmt failures
[[ -n "${cargo_output}" ]] && info "${cargo_output}"
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.

Considering the current info implementation (#7166 (comment)) , which writes to the Step Summary, we end up duplicating the Cargo output in GITHUB_STEP_SUMMARY.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure i see the duplication here. the intent is to log the output in 2 separate places though: in GITHUB_STEP_SUMMARY which has been the default location for a while, as well as in the log output of the step running the fmt command.
I've also not been able to reproduce the duplicated output - am i missing something here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i see it now - will have to think about this one before i commit a fix.
i noticed it also got pulled into the check release job, where it now prints a warn to GITHUB_STEP_SUMMARY where it's not useful information (e.g. WARN: Branch 7166/merge does not match a release pattern. Skipping.).

incidentally, i don't see the duplication in rust format job, but i can see how it could happen based on the logging function(s).

Comment thread .github/scripts/check_release.sh Outdated
# - Branch does not match → exits 0 (all outputs empty/false; downstream
# jobs guard themselves with is_node/signer_release checks)
# Outputs:
# GITHUB_OUTPUT - Path to the GitHub Actions output file (set by runner); prints to stdout if unset
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.

nit: here and other similar scripts: prints to stdout if unset is not really true as they managed by info, which use stderr

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good catch - it was a late change when i changed it to use that logging script vs copying those functions to all scripts. i'll adjust the comments throughout

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

steps:
# Downloads the artifacts built in `create-source-binary`
- name: Download Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
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.

nit: this seems the only one using v6.0.0, while all the others use v8.0.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants