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

build!: convert to typescript #923

Merged
merged 139 commits into from
Apr 9, 2020
Merged

build!: convert to typescript #923

merged 139 commits into from
Apr 9, 2020

Conversation

summer-ji-eng
Copy link
Contributor

@summer-ji-eng summer-ji-eng commented Mar 23, 2020

BREAKING CHANGE: topicPath has been changed to projectTopicPath

Some synthtool hack will be removed once pubsub upgrade to gts:2.0.0

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 23, 2020
@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #923 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #923   +/-   ##
=======================================
  Coverage   94.06%   94.06%           
=======================================
  Files          23       23           
  Lines       10662    10662           
  Branches      503      503           
=======================================
  Hits        10029    10029           
  Misses        630      630           
  Partials        3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4acc3e9...4acc3e9. Read the comment docs.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Apr 7, 2020
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

.mocharc.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@@ -50,7 +50,7 @@ function main(
});

async function publishWithRetrySettings() {
const formattedTopic = publisherClient.topicPath(projectId, topicName);
const formattedTopic = publisherClient.projectTopicPath(projectId, topicName);
Copy link
Contributor

Choose a reason for hiding this comment

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

I am worried this breaking change will get lost in the shuffle for folks. Can we make this super clear in the breaking changes section of the change log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense. But not very clear here, should I update change log in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

@bcoe what's the recommended way to do this? I've done longer form "before / after" descriptions for breaking changes that were meaningful in the past. Is the process here to manually update the CHANGELOG in a followup PR?

clients = ['publisher', 'subscriber']
for client_name in clients:
client_file = f'src/v1/{client_name}_client.ts'
s.replace(client_file,
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh hey, this is great!

r"https://\1)")
# fix tslint issue due to mismatch gts version with gapic-generator-typescript
# it should be removed once pubsub upgrade gts 2.0.0
s.replace(client_file, '\/\/ eslint\-disable\-next\-line\ \@typescript\-eslint\/no\-explicit\-any',
Copy link
Contributor

Choose a reason for hiding this comment

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

The TODO above says we need to upgrade to [email protected]. That happens here right? Can we get rid of this synth change?

synth.py Outdated Show resolved Hide resolved
tsconfig.json Outdated
"outDir": "build",
"resolveJsonModule": true,
"lib": [
"es2016",
Copy link
Contributor

Choose a reason for hiding this comment

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

Still says 2016 :)

@@ -22,7 +22,7 @@ import {promisifyAll} from '@google-cloud/promisify';
import arrify = require('arrify');
import {CallOptions} from 'google-gax';

import {google} from '../proto/iam';
import {google} from '../protos/protos';

Copy link
Contributor

Choose a reason for hiding this comment

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

what does this iam.tsdo? some exported type like SetPolicyResponse can be found in protos.google.iam.v1.IAMPolicy. Thanks!

Copy link
Contributor

@xiaozhenliu-gg5 xiaozhenliu-gg5 left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Thank you Summer!

@@ -50,7 +50,7 @@ function main(
});

async function publishWithRetrySettings() {
const formattedTopic = publisherClient.topicPath(projectId, topicName);
const formattedTopic = publisherClient.projectTopicPath(projectId, topicName);
Copy link
Contributor

Choose a reason for hiding this comment

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

@bcoe what's the recommended way to do this? I've done longer form "before / after" descriptions for breaking changes that were meaningful in the past. Is the process here to manually update the CHANGELOG in a followup PR?

Copy link
Collaborator

@feywind feywind left a comment

Choose a reason for hiding this comment

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

On re-review, this looks pretty nice! I would take another look down the remaining comments, but even as it is, it's fine. We can always tweak it a bit before 2.0.0 if something comes up.

"prettier": "^1.18.2",
"proxyquire": "^2.0.0",
"sinon": "^9.0.0",
"source-map-support": "^0.5.9",
"ts-loader": "^6.2.1",
"typescript": "3.6.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use "typescript": "^3.8.3" as we do for other libraries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussion with @feywind, upgrade typescript ^3.8.3 will happen when pubsub is ready for deprecate Node 8 and upgrade [email protected].

Copy link
Contributor

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

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

LGTM!

@summer-ji-eng summer-ji-eng merged commit 2fc68ba into master Apr 9, 2020
@summer-ji-eng summer-ji-eng deleted the summer_convert branch April 9, 2020 18:19
@release-please release-please bot mentioned this pull request Apr 9, 2020
@JustinBeckwith
Copy link
Contributor

👏 👏 👏

This was referenced Apr 29, 2020
This was referenced May 19, 2020
@release-please release-please bot mentioned this pull request May 20, 2020
feywind pushed a commit to feywind/nodejs-pubsub that referenced this pull request Nov 12, 2024
* docs: fix families typo

* docs: fix initial typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants