Skip to content

Publish "nightly" of main branch to npm for early testing in Kibana #2770

@JoshMock

Description

@JoshMock

We want to enable Kibana to always be able to test against the most recent JS client changes. In order to do this, the hope is that we can improve automation around codegen (and RenovateBot upgrades), testing and publishing to npm so that this requires little to no developer effort.

The desired pipeline:

  1. A PR from an approved "automated" contributor (RenovateBot, elasticmachine, etc) is opened that updates the generated code, dependencies, etc. and has auto-merge enabled
  2. All required checks on the PR run and succeed
  3. The PR is either auto-approved, or these contributors are part of an exception group that does not require PR approval
  4. Auto-merge is triggered and the PR is closed
  5. package.json tag is automatically updated to some non-stable value (e.g. 9.0.1-beta.3), probably by a tool like release-please
  6. Version change triggers a job that does a final build/test/release to npm with a non-stable tag (e.g. beta)

Several improvements and additions to CI jobs and repo settings will be necessary to do this, including (but not limited to):

  • Possible enforcement of conventional commits on all PR merge commits
  • PRs from RenovateBot and elasticmachine (codegen PRs) must have auto-merge enabled
  • path filtering on GitHub actions needs to be removed to ensure unit tests run on all PRs
  • install/configuration of release-please or similar to automate package.json version bump
  • GitHub publish action triggers publish to npm when package.json version number changes on main
  • npm publish must always include an appropriate label to ensure the default latest label is not used
  • npm publish needs to run the full unit test suite matrix, not just on Ubuntu
  • bonus: automate release notes on GitHub release pages and/or release notes in official docs
  • bonus: integration test suite must run and pass (depends on Migrate integration tests to built JS files #2750)

Activity

self-assigned this
on Apr 18, 2025
JoshMock

JoshMock commented on Apr 21, 2025

@JoshMock
MemberAuthor

Another way to accomplish this, if we can't do it entirely based on GitHub event automation, is to create a daily CI job that pulls main, pulls the latest "nightly" tagged release from npm and diffs them against each other. If they differ, it runs the tests and, if successful, publishes a new nightly to npm.

JoshMock

JoshMock commented on Apr 21, 2025

@JoshMock
MemberAuthor

Or, actually: it could run on all merges to main still. It just may not be possible to have codegen and Renovate PRs auto-merge without any human interaction, unfortunately.

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @JoshMock

      Issue actions

        Publish "nightly" of main branch to npm for early testing in Kibana · Issue #2770 · elastic/elasticsearch-js