Skip to content

chore: restore pubsub samples until we can convert them to system tests#7909

Open
feywind wants to merge 369 commits intomainfrom
pubsub-samples
Open

chore: restore pubsub samples until we can convert them to system tests#7909
feywind wants to merge 369 commits intomainfrom
pubsub-samples

Conversation

@feywind
Copy link
Copy Markdown
Contributor

@feywind feywind commented Mar 27, 2026

Fixes #7908 🦕

jkwlui and others added 30 commits December 10, 2018 14:44
chore(deps): update dependency mocha to v6

This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| mocha | devDependencies | major | `^5.2.0` -> `^6.0.0` | [homepage](https://mochajs.org/), [source](https://togithub.com/mochajs/mocha) |

---

### Release Notes

<details>
<summary>mochajs/mocha</summary>

### [`v6.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#&#8203;600--2019-02-18)

[Compare Source](https://togithub.com/mochajs/mocha/compare/v5.2.0...v6.0.0)

#### 🎉 Enhancements

-   [#&#8203;3726](https://togithub.com/mochajs/mocha/issues/3726): Add ability to unload files from `require` cache ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))

#### 🐛 Fixes

-   [#&#8203;3737](https://togithub.com/mochajs/mocha/issues/3737): Fix falsy values from options globals ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))
-   [#&#8203;3707](https://togithub.com/mochajs/mocha/issues/3707): Fix encapsulation issues for `Suite#_onlyTests` and `Suite#_onlySuites` ([**@&#8203;vkarpov15**](https://togithub.com/vkarpov15))
-   [#&#8203;3711](https://togithub.com/mochajs/mocha/issues/3711): Fix diagnostic messages dealing with plurality and markup of output ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))
-   [#&#8203;3723](https://togithub.com/mochajs/mocha/issues/3723): Fix "reporter-option" to allow comma-separated options ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3722](https://togithub.com/mochajs/mocha/issues/3722): Fix code quality and performance of `lookupFiles` and `files` ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))
-   [#&#8203;3650](https://togithub.com/mochajs/mocha/issues/3650), [#&#8203;3654](https://togithub.com/mochajs/mocha/issues/3654): Fix noisy error message when no files found ([**@&#8203;craigtaub**](https://togithub.com/craigtaub))
-   [#&#8203;3632](https://togithub.com/mochajs/mocha/issues/3632): Tests having an empty title are no longer confused with the "root" suite ([**@&#8203;juergba**](https://togithub.com/juergba))
-   [#&#8203;3666](https://togithub.com/mochajs/mocha/issues/3666): Fix missing error codes ([**@&#8203;vkarpov15**](https://togithub.com/vkarpov15))
-   [#&#8203;3684](https://togithub.com/mochajs/mocha/issues/3684): Fix exiting problem in Node.js v11.7.0+ ([**@&#8203;addaleax**](https://togithub.com/addaleax))
-   [#&#8203;3691](https://togithub.com/mochajs/mocha/issues/3691): Fix `--delay` (and other boolean options) not working in all cases ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3692](https://togithub.com/mochajs/mocha/issues/3692): Fix invalid command-line argument usage not causing actual errors ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3698](https://togithub.com/mochajs/mocha/issues/3698), [#&#8203;3699](https://togithub.com/mochajs/mocha/issues/3699): Fix debug-related Node.js options not working in all cases ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3700](https://togithub.com/mochajs/mocha/issues/3700): Growl notifications now show the correct number of tests run ([**@&#8203;outsideris**](https://togithub.com/outsideris))
-   [#&#8203;3686](https://togithub.com/mochajs/mocha/issues/3686): Avoid potential ReDoS when diffing large objects ([**@&#8203;cyjake**](https://togithub.com/cyjake))
-   [#&#8203;3715](https://togithub.com/mochajs/mocha/issues/3715): Fix incorrect order of emitted events when used programmatically ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3706](https://togithub.com/mochajs/mocha/issues/3706): Fix regression wherein `--reporter-option`/`--reporter-options` did not support comma-separated key/value pairs ([**@&#8203;boneskull**](https://togithub.com/boneskull))

#### 📖 Documentation

-   [#&#8203;3652](https://togithub.com/mochajs/mocha/issues/3652): Switch from Jekyll to Eleventy ([**@&#8203;Munter**](https://togithub.com/Munter))

#### 🔩 Other

-   [#&#8203;3677](https://togithub.com/mochajs/mocha/issues/3677): Add error objects for createUnsupportedError and createInvalidExceptionError ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3733](https://togithub.com/mochajs/mocha/issues/3733): Removed unnecessary processing in post-processing hook ([**@&#8203;wanseob**](https://togithub.com/wanseob))
-   [#&#8203;3730](https://togithub.com/mochajs/mocha/issues/3730): Update nyc to latest version ([**@&#8203;coreyfarrell**](https://togithub.com/coreyfarrell))
-   [#&#8203;3648](https://togithub.com/mochajs/mocha/issues/3648), [#&#8203;3680](https://togithub.com/mochajs/mocha/issues/3680): Fixes to support latest versions of [unexpected](https://npm.im/unexpected) and [unexpected-sinon](https://npm.im/unexpected-sinon) ([**@&#8203;sunesimonsen**](https://togithub.com/sunesimonsen))
-   [#&#8203;3638](https://togithub.com/mochajs/mocha/issues/3638): Add meta tag to site ([**@&#8203;MartijnCuppens**](https://togithub.com/MartijnCuppens))
-   [#&#8203;3653](https://togithub.com/mochajs/mocha/issues/3653): Fix parts of test suite failing to run on Windows ([**@&#8203;boneskull**](https://togithub.com/boneskull))

</details>

---

### Renovate configuration

:date: **Schedule**: "after 9am and before 3pm" (UTC).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`".

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-pubsub).

#488 automerged by dpebot
refactor: use execSync for tests

#564 automerged by dpebot
* Relax strictEqual to match RegExp

* assert.include

* use assert.include

* npm run fix

* fix: await was accidentally removed causing tests to break

* Revert "npm run fix"

This reverts commit f1468257881b429b25ef81ef1a2c4128b9ec3d96.

* npm run fix

* remove await before execSync

* is it execa?

* use cp.exec for sync-pull test because it might be blocking io

* return the Promise

* fix listen to error test - process exited 0, didn`t have Error

* uninstall execa;

* npm run fix

* clean up
* updated CHANGELOG.md

* updated package.json

* updated samples/package.json
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
* Rewrite flowcontrol sample

* Alex's suggestions

* reset & passed all tests locally

* lint

* lint

* comment

* kir's suggestions

* Dave's suggestions

* change timeout back to 10 sec
feywind and others added 28 commits September 24, 2024 19:11
… support it (#1973)

* samples: add optimisticSubscribe, plus a few small library changes to support it

* fix: simplify DebugMessage handling of StatusError

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: fix copyright date

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…es (#1985)

* build: fix a small issue with the typeless bot invocation

* samples: add samples for cloud storage ingestion

* samples: fix a paste-o in Kinesis sample

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* samples: fix paste-o with incorrect sample function name

* tests: fix sample test quotes

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(main): release 4.8.0

* chore(main): release 4.8.0

* build: also link the current pubsub version

* chore(main): release 4.8.0

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: feywind <57276408+feywind@users.noreply.github.com>
* samples: update publishing samples to clarify that topic objects should be cached; also fix a usage of publish()

* samples: convert publishWithRetrySettings to use veneer

* samples: update publishWithRetrySettings with new defaults; add comment about including all items

* docs: clarify what subscriber batching means

* samples: update EOD sample with endpoint

* samples: add comments about ordered publishing as well
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* docs: Add ingestion from Kafka samples and tests

* chore: Fix formatting in samples
* fix: type widening to match gapic, and two typing fixes

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* build: dodge broken version of promisify

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore!: migrate to Node 18

* chore: linter fix pass

* chore: remove accidentally added file

* samples: fix linting and typelessing of samples

* build: remove typeless bot stuff from owlbot.py

* feat: fix a bunch of linter errors, and import new gapic classes

* fix: revert some of the promise fixes

* tests: fix various test issues caused by version upgrades

* chore: linter fixes

* chore: try to bypass linting on TS samples for now

* build: try updating lint and samples scripts

* build: two owlbot related updates

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* build: revert execa to dodge esm for now

* chore: also revert execa import for older version

* chore: update execa reference once more

* chore!: remove legacy otel support

* feat!: remove legacy ack deadline parameters, and move maxExtension into subscriber options

* build: further revert execa's version

* build: more execa adjustments

* feat: time to say goodbye to some more old OTel cruft

* tests: this will be the day ... that tsc starts paying attention to @internal, apparently

* chore: revert package.json version changes so release-please can do it

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop*
---


## [5.0.0](https://togithub.com/googleapis/nodejs-pubsub/compare/v4.11.0...v5.0.0) (2025-04-28)


### ⚠ BREAKING CHANGES

* migrate to Node 18 ([#2024](https://togithub.com/googleapis/nodejs-pubsub/issues/2024))
* remove (broken) legacy OTel support
* remove legacy ack deadline options
* move maxExtension into subscriber options

### Miscellaneous Chores

* Migrate to Node 18 ([#2024](https://togithub.com/googleapis/nodejs-pubsub/issues/2024)) ([8b0f5eb](https://togithub.com/googleapis/nodejs-pubsub/commit/8b0f5eb862f513fe8011beb36d6a8554d784b483))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…#2035)

I just noticed this while doing something unrelated.
* chore(main): release 5.1.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Megan Potter <57276408+feywind@users.noreply.github.com>
#2068)

* feat: Add timeout option to Subscription.close()

Implements a new `timeout` option (using `Duration`) for the `Subscription.close()` method.

This provides more control over the shutdown process:
- If `timeout` is zero, the subscription closes as quickly as possible without nacking buffered messages.
- If `timeout` is positive, the subscription attempts to nack any buffered messages (in the lease manager) and waits up to the specified duration for pending acknowledgements and nacks to be sent to the server.
- If no timeout is provided, the behavior remains as before (waits indefinitely for pending acks/modacks, no nacking).

The core logic is implemented in `Subscriber.close()`. `PubSub.close()` documentation is updated to clarify its scope and recommend using `Subscription.close()` directly for this feature.

Includes:
- Unit tests for the new timeout behavior in `Subscriber.close()`.
- A TypeScript sample (`samples/closeSubscriptionWithTimeout.ts`) demonstrating usage.
- Updated JSDoc documentation for relevant methods.

* docs: revert README change so release-please can do it

* feat: jules' vibin' is too lo-fi, fix some bad assumptions

* samples: typeless a JS sample for close with timeout

* feat: add awaitWithTimeout and test

* tests: also test error results without timeout

* feat: update for the current spec, test updates coming

* tests: misc fixes before further additions

* feat: update Temporal shims to match latest standards

* chore: linter fix

* feat: update to latest spec doc info, finish unit tests

* feat: also move the options from close() parameters to subscriber options

* chore: fix linter errors

* samples: update to latest API changes

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: no need to check isEmpty on remove

* chore: remove unneeded promise skip code

* fix: substantially clarify the awaitWithTimeout interface

* chore: hoist timeout logic into its own method

* fix: tests were leaking EventEmitter handlers

* chore: change constant to CONSTANT_CASE

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: move off the remaining rc versions

* fix: move off rc version of gax
* chore(main): release 5.2.1

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* tests: fix two system-test bugs with one scone

* tests: modernize system tests with individual resources per test

* chore: update the headers on duplicated files to please the bot

* tests: remove thirty and sixty constants, shift to number of subs

* tests: uncomment commented code for later use
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix(deps): update all dependencies

* build: revert .github/scripts changes, they are templated

* build: revert some potentially incompatible changes in samples/package.json

* build: revert some potentially incompatible changes in package.json

* build: downgrade incompatible trace exporter

* build: downgrade to non-ESM uuid

* build: downgrade to non-ESM uuid

* build: gts update needs other changes

* build: gts update needs other changes

---------

Co-authored-by: feywind <57276408+feywind@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pubsub] Restore samples