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 #2679: remove-exploration-java-proto-lite from the model library #2700

Merged

Conversation

yashraj-01
Copy link
Contributor

Explanation

Fixes #2679 . Removed :exploration_java_proto_lite from the model library. Added visibility = ["//visibility:public"], to the java_lite_proto_library that has the name exploration_java_proto_lite.

The build was successful after Step 1 and Step 2. So, it was not required to follow Step 3.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@yashraj-01
Copy link
Contributor Author

@fsharpasharp @rt4914 PTAL.

@fsharpasharp
Copy link
Contributor

It is unexpected to me that the app will build without step 3. Make sure that you are building the entire application.

We'll have to wait for the checks to be fixed and rerun the checks. Everything else looks good.

@@ -186,14 +186,14 @@ format_import_proto_library(
java_lite_proto_library(
name = "exploration_java_proto_lite",
deps = [":exploration_proto"],
visibility = ["//visibility:public"],
Copy link
Contributor

Choose a reason for hiding this comment

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

In general we should avoid doing this. Any reason why we want to make this public?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vinitamurthi, are you saying that we should be explicit about the visibility?

Copy link
Member

Choose a reason for hiding this comment

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

Does #2699 (comment) help clarify the need @vinitamurthi or do you have a separate concern?

@vinitamurthi vinitamurthi removed their assignment Feb 12, 2021
@yashraj-01
Copy link
Contributor Author

Screenshot from 2021-02-12 22-13-40

@fsharpasharp I am somehow getting this error now. Previously it worked fine but now this error is coming. I also followed the fix provided above but it also does not work. Please help me to fix this error.

@fsharpasharp
Copy link
Contributor

Replace ~ with your home directory.

@yashraj-01
Copy link
Contributor Author

Replace ~ with your home directory.

In which of the following commands should I replace it. I'm currently at step 4.
Screenshot from 2021-02-12 22-44-29

@fsharpasharp
Copy link
Contributor

In your ~/.bazelrc file

@BenHenning
Copy link
Member

BenHenning commented Feb 13, 2021

Similar to #2699 (comment) we need verify that all targets are now building with this change. Updating the branch to trigger a full run of all affected Bazel test targets.

@yashraj-01
Copy link
Contributor Author

It is unexpected to me that the app will build without step 3. Make sure that you are building the entire application.

We'll have to wait for the checks to be fixed and rerun the checks. Everything else looks good.

Screenshot from 2021-02-13 21-33-36
@fsharpasharp I again ran the build and it is showing build successful. What do you suggest I should do?

@yashraj-01
Copy link
Contributor Author

@BenHenning @vinitamurthi PTAL.

@fsharpasharp
Copy link
Contributor

I see that there is one failing check. Try to identify the issue and make sure that the all the tests pass locally as well. Let me know if you get stuck.

Run

~/oppia-bazel/bazel test //app/...

and

~/oppia-bazel/bazel test //...

if the previous one passes.

@yashraj-01
Copy link
Contributor Author

I see that there is one failing check. Try to identify the issue and make sure that the all the tests pass locally as well. Let me know if you get stuck.

Run

~/oppia-bazel/bazel test //app/...

and

~/oppia-bazel/bazel test //...

if the previous one passes.

#2722 (comment)

I asked @FareesHussain about this failed check and he said it just needs a re-run. I have attached the link of the comment.

Also, when I ran the test you mentioned, it gets stuck at check number 11,978.

Please, tell me how to proceed now.

@fsharpasharp
Copy link
Contributor

fsharpasharp commented Feb 16, 2021

Okay, could you try to sync to head and run the checks again? It could help us rule out if it's a problem with the current commit or with the CI.

@BenHenning
Copy link
Member

Deferring to @fsharpasharp to figure out why we're seeing what appears to be Java proto lite libraries being generated for each proto (including transitive proto dependencies). Please reassign me once this PR is ready for review.

@BenHenning BenHenning closed this Feb 17, 2021
@BenHenning BenHenning reopened this Feb 17, 2021
@BenHenning
Copy link
Member

Ah, didn't meant to close the PR. Checks are re-running now, sorry about that. Old checks can be seen in the commit above, but some might get cancelled by the automatic canceller.

@BenHenning BenHenning removed their assignment Feb 17, 2021
@yashraj-01
Copy link
Contributor Author

@fsharpasharp @BenHenning all the checks have passed. PTAL. Thanks.

@fsharpasharp
Copy link
Contributor

I'm going to spend some time to look into where the dependency is getting pulled from. I'll open some similar issues in the meantime, if you are itching to do some more work. Thanks for the patience, @yashraj-iitr.

@fsharpasharp
Copy link
Contributor

fsharpasharp commented Feb 23, 2021

  format_import_proto_library(                                                                                                                                                                 
      name = "question",                                                                                                                                                                       
      src = "src/main/proto/question.proto",                                                                                                                                                   
      deps = [                                                                                                                                                                                 
          ":exploration_proto",                                                                                                                                                                
          ":subtitled_html_proto",                                                                                                                                                             
          ":subtitled_unicode_proto",                                                                                                                                                          
      ],                                                                                                                                                                                       
  )                                                                                                                                                                                            
                                                                                                                                                                                               
  java_lite_proto_library(                                                                                                                                                                     
      name = "question_java_proto_lite",                                                                                                                                                       
      deps = [":question_proto"],                                                                                                                                                              
  )   

question_java_proto_lite is indirectly exporting the exploration proto. I think we can go ahead and merge this PR, @BenHenning . When we remove the question_java_proto_lite from the exports list of model we can add both dependencies back to where they are used.

To be thorough we could remove

visibility = ["//visibility:public"],

from the exploration_java_proto_lite library in this PR. This could make it clear how the dependency propagates.

@BenHenning
Copy link
Member

Ack, it seems like we can't solve this right now but moving in this direction is still satisfying Bazel's proto best practices.

@BenHenning BenHenning added the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Feb 24, 2021
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Per my comment above, we'll just keep in mind that protos imply transitive dependencies as we modularize the codebase. We should take care to try and depend on the most specific proto possible for a given context.

Approved since this is solving the original issue. Thanks @yashraj-iitr!

@BenHenning BenHenning removed the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Feb 24, 2021
@BenHenning BenHenning enabled auto-merge (squash) February 24, 2021 07:34
@BenHenning BenHenning merged commit 302a181 into oppia:develop Feb 24, 2021
@yashraj-01 yashraj-01 deleted the remove-exploration-java-proto-lite branch February 24, 2021 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove :exploration_java_proto_lite from the model library
4 participants