Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-work publish workflow to automatically set version if not defined #17

Merged
merged 7 commits into from
Nov 4, 2024

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Oct 31, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13058

📔 Objective

Publish wasm automatically on merge to main. Determine version from job-id and branch.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.85%. Comparing base (5905354) to head (c2397c3).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   62.85%   62.85%           
=======================================
  Files         179      179           
  Lines       12688    12688           
=======================================
  Hits         7975     7975           
  Misses       4713     4713           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hinton Hinton marked this pull request as ready for review October 31, 2024 11:29
@Hinton Hinton requested a review from a team as a code owner October 31, 2024 11:29
@Hinton Hinton requested review from a team and coroiu October 31, 2024 11:29
@Hinton
Copy link
Member Author

Hinton commented Oct 31, 2024

@bitwarden/dept-bre is there a way to ensure we only publish wasm IF the "run tests" workflow succeeds? I.e. depend on the result of another workflow.

coroiu
coroiu previously approved these changes Nov 1, 2024
Comment on lines +99 to +105
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'bitwarden',
repo: 'sdk-internal',
workflow_id: 'publish-wasm-internal.yml',
ref: 'main',
})
Copy link
Contributor

Choose a reason for hiding this comment

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

question: is this how GH actions work? You have to trigger another workflow using a script?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes 😞

Copy link
Member

Choose a reason for hiding this comment

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

You can do it this way, but you can also use a workflow_call trigger in the workflow you want to call. There are pros and cons to each method.

@vgrassia
Copy link
Member

vgrassia commented Nov 1, 2024

@bitwarden/dept-bre is there a way to ensure we only publish wasm IF the "run tests" workflow succeeds? I.e. depend on the result of another workflow.

The easiest way would be to call the "run tests" workflow in another job and add it to the needs key of the publish wasm job. You could probably do some sort of logic to get the run id of the triggered "run tests" workflow, but you would still have to use a loop to constantly check if it completes successfully or not.

@Hinton Hinton merged commit 8afb703 into main Nov 4, 2024
39 checks passed
@Hinton Hinton deleted the ps/auto-publish branch November 4, 2024 10:10
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.

3 participants