Skip to content

Conversation

@evindj
Copy link
Contributor

@evindj evindj commented Jul 10, 2017

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify.
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

@evindj evindj changed the title [Beam-2230] ApiSurface Refactoring [BEAM-2230] ApiSurface Refactoring Jul 10, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 71.011% when pulling 25c6a62 on evindj:BEAM-2230 into 9f904dc on apache:master.

@evindj
Copy link
Contributor Author

evindj commented Jul 17, 2017

@kennknowles would you please review and let me know if I need to make some changes?

*/
@SuppressWarnings("rawtypes")
public class ApiSurface {
public abstract class ApiSurface {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to make this abstract and have subclasses extend ApiSurface. Really, we just need to build values of type ApiSurface. Something like this: directRunnerApiSurface() { return <build the API surface>; }.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I evaluated writing custom methods in ApiSurface but decided not to go that route because some of the ApiSurface test implementation made calls like getClass().getPackage() which I think make them couple to the namespace where they are defined. Also, I think it is good to provide each package a way to build their ApiSurface they way they want through the buildApiSurface() Method.

Copy link
Member

Choose a reason for hiding this comment

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

I mean this:

package org.apache.beam.sdk.util;

public class ApiSurface { ... just like now ... }

And separately

class DirectRunnerApiSurfaceTest {
  private static ApiSurface directRunnerApiSurface() { ... }

  @Test
  public void testApiSurface() {
    assertThat(directRunnerApiSurface(), containsOnlyClassFrom(....));
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you are saying now ApiSurface is not meant to be defined by modules just to verify the set of entities they expose. will make the change accordingly. Thanks for the review.


/** Returns an empty {@link ApiSurface}. */
public static ApiSurface empty() {
private ApiSurface empty() {
Copy link
Member

Choose a reason for hiding this comment

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

Why is it not static now? And for all of the methods below, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a side effect of making the class abstract, since it was constructing an object.

@evindj evindj closed this Jul 21, 2017
@evindj evindj reopened this Jul 21, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 70.598% when pulling e70a64d on evindj:BEAM-2230 into 1d9160f on apache:master.

@evindj
Copy link
Contributor Author

evindj commented Jul 22, 2017

@kennknowles modified this as per your comments.

@evindj
Copy link
Contributor Author

evindj commented Aug 2, 2017

Please @kennknowles Still waiting for your feedback on this.

@kennknowles
Copy link
Member

R: @kennknowles

I was just on some vacation, but will be doing lots of reviews now that I am back. Soon.

@evindj
Copy link
Contributor Author

evindj commented Aug 29, 2017

ping @kennknowles

@kennknowles kennknowles self-assigned this Jan 25, 2018
@kennknowles
Copy link
Member

kennknowles commented Apr 24, 2018

In fact, the way the ApiSurface tests have been made to scan the classpath is pretty fundamentally broken. I think probably the best thing to do to avoid blocking peoples' work is to remove the tests.

(your change is looking good, but the basis is just not right, sorry for the time you spent here!)

@kennknowles kennknowles removed their assignment Apr 24, 2018
@evindj
Copy link
Contributor Author

evindj commented May 6, 2018

@kennknowles no problem, I am going to look into removing them if that has not been taken care of yet.

@kennknowles
Copy link
Member

We have turned on autoformatting of the codebase, which causes small conflicts across the board. You can probably safely rebase and just keep your changes. Like this:

$ git rebase
... see some conflicts
$ git diff
... confirmed that the conflicts are just autoformatting
... so we can just keep our changes are do our own autoformat
$ git checkout --theirs --
$ git add -u
$ git rebase --continue
$ ./gradlew spotlessJavaApply

Please ping me if you run into any difficulty.

@stale
Copy link

stale bot commented Aug 27, 2018

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions.

@stale stale bot added the stale label Aug 27, 2018
@stale
Copy link

stale bot commented Sep 3, 2018

This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@stale stale bot closed this Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants