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

fix saving of comment ids to disk #221

Merged
merged 2 commits into from
Jan 9, 2024
Merged

fix saving of comment ids to disk #221

merged 2 commits into from
Jan 9, 2024

Conversation

jakemac53
Copy link
Contributor

@jakemac53 jakemac53 commented Jan 9, 2024

See the failure here https://github.com/dart-lang/build/actions/runs/7463208455/job/20307339352?pr=3638#step:9:3.

Changes findCommentId to again return an int? instead of an IssueComment?.

Alternatively, we could rename this to findComment, and return the entire comment, but we only ever use the ID.

We just call toString() on the return value of this function and serialize it to disk, so when it changed to an IssueComment it no longer serialized the ID.

Copy link

github-actions bot commented Jan 9, 2024

Package publishing

Package Version Status Publish tag (post-merge)
package:firehose 0.5.1 ready to publish firehose-v0.5.1
package:dart_flutter_team_lints 2.1.1 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

Copy link

github-actions bot commented Jan 9, 2024

PR Health

Breaking changes ⚠️

Details
Package Change Current Version New Version Needed Version Looking good?
firehose Breaking 0.5.0 0.5.1 0.6.0
Got "0.5.1" expected >= "0.6.0" (breaking changes)
⚠️

This check can be disabled by tagging the PR with skip-breaking-check

Changelog Entry ✔️

Details
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ✔️

Details
File Coverage
pkgs/firehose/lib/src/github.dart 💚 62 % ⬆️ 1 %

This check for test coverage is informational (issues shown here will not fail the PR).

License Headers ✔️

Details
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Package publish validation ✔️

Details
Package Version Status
package:firehose 0.5.1 ready to publish
package:dart_flutter_team_lints 2.1.1 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@jakemac53
Copy link
Contributor Author

I am not sure why this is being flagged as breaking, given this is a private API only?

@parlough
Copy link
Member

parlough commented Jan 9, 2024

I am not sure why this is being flagged as breaking, given this is a private API only?

\cc @mosuem

@mosuem
Copy link
Member

mosuem commented Jan 9, 2024

I am not sure why this is being flagged as breaking, given this is a private API only?

The log says

{
  "label": "Class GithubApi",
  "children": [
    {
      "label": "Method findCommentId",
      "children": [
        {
          "changeDescription": "Return type changed. Future<IssueComment?> -> Future<int?>",
          "changeCode": "CE09",
          "isBreaking": true,
          "type": "minor"
        }
      ]
    }
  ]
}

Probably because files in lib/src are technically part of the public API, even if importing them is discouraged.
cc @devmil

@devmil
Copy link

devmil commented Jan 9, 2024

I am not sure why this is being flagged as breaking, given this is a private API only?

[...]

Probably because files in lib/src are technically part of the public API, even if importing them is discouraged.

cc @devmil

Will have a look.

Dart files in src are considered private as long as they are not exported outside, so that should not be the reason.
Is the modified type used in some public API? Then it would be considered implicitly public as client code could interact with it without importing it

@jakemac53
Copy link
Contributor Author

Dart files in src are considered private as long as they are not exported outside, so that should not be the reason.
Is the modified type used in some public API? Then it would be considered implicitly public as client code could interact with it without importing it

I don't see it being exposed (there are no exports from lib/firehose.dart). However, I see that Firehose.verify takes a GithubApi typed parameter, even though there is no way to see that type, which seems like an oversight.

@devmil
Copy link

devmil commented Jan 9, 2024

Dart files in src are considered private as long as they are not exported outside, so that should not be the reason.
Is the modified type used in some public API? Then it would be considered implicitly public as client code could interact with it without importing it

I don't see it being exposed (there are no exports from lib/firehose.dart). However, I see that Firehose.verify takes a GithubApi typed parameter, even though there is no way to see that type, which seems like an oversight.

I think this method is why dart_apitool considers it part of the public API:

Future<VerificationResults> verify(GithubApi github) async {

Technically it can not break consumer code (and the method can't be called with something meaningful) so we could extend dart_apitool to consider the data flow direction for this as well.

For now you probably can bypass it by making the verify method private. No, you can't as this is another breaking change :/

@jakemac53
Copy link
Contributor Author

Technically it can not break consumer code (and the method can't be called with something meaningful) so we could extend dart_apitool to consider the data flow direction for this as well.

I think that is reasonable, but I do also think it indicates a mistake on the part of the API.

There should not be public apis, which take parameters whose types are from private libraries in the same package (or another package, for that matter). All types exposed through public APIs, should also be public (although they don't need to be exported from the same exact library).

@jakemac53
Copy link
Contributor Author

Fwiw, I would be happy to make the breaking change as well, to make verify private, whatever you all think is appropriate.

pkgs/firehose/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Nate Bosch <nbosch@google.com>
@jakemac53
Copy link
Contributor Author

Going to go ahead and land as is given the two approvals

@jakemac53 jakemac53 merged commit 1e2785d into main Jan 9, 2024
22 checks passed
@jakemac53 jakemac53 deleted the comment-id branch January 9, 2024 18:46
@devmil
Copy link

devmil commented Jan 9, 2024

I think that is reasonable, but I do also think it indicates a mistake on the part of the API.

There should not be public apis, which take parameters whose types are from private libraries in the same package (or another package, for that matter). All types exposed through public APIs, should also be public (although they don't need to be exported from the same exact library).

@mosuem fyi. dart_apitool already has a flag to check for missing exports in the "extract" command: --set-exit-on-missing-export. We could think about another option that is not as harsh and include this information in the generated report.

So that's enough hijacking of a closed PR :)

copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Jan 9, 2024
…, shelf, tools, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (https://github.com/dart-lang/async/compare/9924570..e83d054):
  e83d054  2024-01-08  Futuristic Goo  Fix typo (dart-archive/async#262)

ecosystem (https://github.com/dart-lang/ecosystem/compare/dc44e82..1e2785d):
  1e2785d  2024-01-09  Jacob MacDonald  fix saving of comment ids to disk (dart-lang/ecosystem#221)
  244a28d  2024-01-09  Moritz  Update publish.yaml (dart-lang/ecosystem#217)
  bab9833  2024-01-09  Moritz  Fix health commenting (dart-lang/ecosystem#219)
  f87e6f4  2024-01-08  Moritz  Update health workflow (dart-lang/ecosystem#216)
  a58c7d8  2024-01-03  Moritz  Fix `labeler.yml` (dart-lang/ecosystem#214)

leak_tracker (https://github.com/dart-lang/leak_tracker/compare/3d4c0d6..4a5b077):
  4a5b077  2024-01-09  Polina Cherkasova  Enhance scripting. (dart-lang/leak_tracker#204)
  e7094f4  2024-01-08  Polina Cherkasova  Ignore test helpers. (dart-lang/leak_tracker#196)
  6591934  2024-01-03  Polina Cherkasova  Handle deprecation in Flutter. (dart-lang/leak_tracker#203)

markdown (https://github.com/dart-lang/markdown/compare/d2e7903..7fdfa55):
  7fdfa55  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (dart-lang/markdown#571)
  5fab3a7  2023-12-19  Alex Li  ✨ Introduce AlertBlockSyntax (dart-lang/markdown#570)

native (https://github.com/dart-lang/native/compare/0605d9a..14f6da1):
  14f6da1d  2024-01-09  Simon Binder  Support `@Native` fields and `addressOf` (dart-lang/native#860)

protobuf (https://github.com/dart-lang/protobuf/compare/20ec685..a293fb9):
  a293fb9  2024-01-08  Ömer Sinan Ağacan  Handle deprecated options in grpc services and methods, enum types and values, messages (google/protobuf.dart#908)
  9a408a7  2024-01-08  Ömer Sinan Ağacan  Generate docs of enums and rpc clients, some refactoring (google/protobuf.dart#909)
  c4fd596  2024-01-06  Ömer Sinan Ağacan  Export GeneratedMessageGenericExtensions in generated files (google/protobuf.dart#907)

shelf (https://github.com/dart-lang/shelf/compare/733588f..823966f):
  823966f  2024-01-03  Moritz  Fix `labeler.yml` (dart-lang/shelf#403)

tools (https://github.com/dart-lang/tools/compare/2f59ab4..8ffc077):
  8ffc077  2024-01-03  Moritz  Fix `labeler.yml` (dart-lang/tools#224)

webdev (https://github.com/dart-lang/webdev/compare/b2405cb..c08a65c):
  c08a65c9  2024-01-09  Elliott Brooks  Loosen `vm_service` constraints and prepare DWDS for release to 23.1.1 (dart-lang/webdev#2329)
  651bdae6  2024-01-08  Derek Xu  Make FrontendServerClient start the frontend server from AOT snapshot by default (dart-lang/webdev#2263)
  4d1de266  2024-01-03  Elliott Brooks  Prepare DWDS for release to version 23.1.0 (dart-lang/webdev#2328)

Change-Id: I4d7fd994cc54ac2d72335c3ebf40710f3bd020e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345366
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants