Move composites into stacks-core and refactor workflows#7166
Move composites into stacks-core and refactor workflows#7166wileyj wants to merge 32 commits intostacks-network:developfrom
Conversation
Coverage Report for CI Build 25584487095Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage decreased (-0.1%) to 85.6%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions3263 previously-covered lines in 86 files lost coverage.
Coverage Stats
💛 - Coveralls |
| 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 |
There was a problem hiding this comment.
maybe we could redirect all the logging to stderr just in case we need sh scripts to return some value on the stdout
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Co-authored-by: Federico De Felici <234774522+federico-stacks@users.noreply.github.com>
| if: >- | ||
| github.repository == 'stacks-network/stacks-core' && | ||
| (inputs.node_tag != '' || inputs.signer_tag != '') |
There was a problem hiding this comment.
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.
… when running a script locally
| 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}" |
There was a problem hiding this comment.
Considering the current info implementation (#7166 (comment)) , which writes to the Step Summary, we end up duplicating the Cargo output in GITHUB_STEP_SUMMARY.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
| # - 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 |
There was a problem hiding this comment.
nit: here and other similar scripts: prints to stdout if unset is not really true as they managed by info, which use stderr
There was a problem hiding this comment.
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
| steps: | ||
| # Downloads the artifacts built in `create-source-binary` | ||
| - name: Download Artifacts | ||
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 |
There was a problem hiding this comment.
nit: this seems the only one using v6.0.0, while all the others use v8.0.1
…release body template
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:
in addiitional to many minor changes:
contents:read, and elevated where needed.logging.shscript - no moreecho "something", we may now use `info "something"; error "something broke"some sample workflow runs: