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 #13347 #13562 #14285: Introduce new attribute proto_size_in_bytes for Exploration models #13391

Closed
wants to merge 286 commits into from

Conversation

anandwana001
Copy link
Contributor

@anandwana001 anandwana001 commented Jul 13, 2021

Overview

  1. This PR fixes
  1. This PR does the following: adding proto_size_in_bytes attributes for exploration model
    1. This PR introduced a new attribute proto_size_in_bytes in the exploration model. This attribute will contain the proto size of the exploration.
    2. The size calculation is done using the proto files provided by the [oppia-proto-api](https://github.com/oppia/oppia-proto-api/tree/introduce-proto-api-v1) repository.
    3. This PR introduced functions to_proto for the classes which are required to fill the proto fields and other respective functions:
      • class Exploration
      • class State
      • class AnswerGroup
      • class Hint
      • class Solution
      • class InteractionInstance
      • class Outcome
      • class Voiceover
      • class WrittenTranslation
      • class WrittenTranslations
      • class RecordedVoiceovers
      • class SubtitledHtml
      • class SubtitledUnicode
      • class TranslatableItem
    4. I had tried to write test cases for all the public functions introduced in this PR.
    5. core/tests/data/oppia-ThetitleforZIPdownloadhandlertest!-v2-gold.zip - This zip file is updated by adding this new attribute proto_size_in_bytes. This can be reviewed by locally unzipping and checking if the attribute is correct or not.
    6. The way we are bringing the proto files to the codebase is mentioned in the file scripts/install_third_party_libs.py.

TODO

  1. All checks should pass
  2. Write leftover test cases for beam job

Essential 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 linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

Proof that changes are correct

Screenshot 2021-07-13 at 17 08 55

Screenshot 2021-12-17 at 17 23 17

PR Pointers

  • Make sure to follow the instructions for making a code change.
  • Oppiabot will notify you when you don't add a PR_CHANGELOG label. If you are unable to do so, please @-mention a code owner (who will be in the Reviewers list), or ask on Gitter.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays.
  • Never force push. If you do, your PR will be closed.
  • Oppiabot can assign anyone for review/help if you leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL"
  • Some of the e2e tests are flaky, and can fail for reasons unrelated to your PR. We are working on fixing this, but in the meantime, if you need to restart the tests, please check the "If your build fails" wiki page.

@oppiabot
Copy link

oppiabot bot commented Jul 13, 2021

Hi @anandwana001, can you complete the following:

  1. The proof that changes are correct has not been provided, please make sure to upload a image/video showing that the changes are correct. Or include a sentence saying "No proof of changes needed because" and the reason why proof of changes cannot be provided.
    Thanks!

@oppiabot
Copy link

oppiabot bot commented Jul 13, 2021

Hi, @anandwana001, this pull request does not have a "CHANGELOG: ..." label as mentioned in the PR pointers. Assigning @anandwana001 to add the required label. PRs without this label will not be merged. If you are unsure of which label to add, please ask the reviewers for guidance. Thanks!

@anandwana001 anandwana001 marked this pull request as draft July 13, 2021 06:45
@oppiabot
Copy link

oppiabot bot commented Jul 13, 2021

Hi @anandwana001, when creating WIP/Draft PRs, ensure that your commit messages are prefixed with [ci skip] or [skip ci] to prevent CI checks from running. You can learn more about it here.

1 similar comment
@oppiabot
Copy link

oppiabot bot commented Jul 14, 2021

Hi @anandwana001, when creating WIP/Draft PRs, ensure that your commit messages are prefixed with [ci skip] or [skip ci] to prevent CI checks from running. You can learn more about it here.

@oppiabot
Copy link

oppiabot bot commented Jul 14, 2021

Hi @DubeySandeep, this PR adds a new code owner, @anandwana001 to the following files /core/domain/exploration.proto, /core/domain/exploration_pb2.py. Please make sure the changes are verified by the previous codeowner(s) of the file. Thanks!

core/domain/exp_domain.py Outdated Show resolved Hide resolved
@oppiabot
Copy link

oppiabot bot commented Jul 15, 2021

Hi @DubeySandeep, this PR adds a new code owner, @anandwana001 to the following files /core/domain/exploration.proto, /core/domain/exploration_pb2.py. Please make sure the changes are verified by the previous codeowner(s) of the file. Thanks!

@oppiabot
Copy link

oppiabot bot commented Jul 16, 2021

Hi @DubeySandeep, this PR adds a new code owner, @anandwana001 to the following files /core/domain/exploration.proto, /core/domain/exploration_pb2.py. Please make sure the changes are verified by the previous codeowner(s) of the file. Thanks!

1 similar comment
@oppiabot
Copy link

oppiabot bot commented Jul 17, 2021

Hi @DubeySandeep, this PR adds a new code owner, @anandwana001 to the following files /core/domain/exploration.proto, /core/domain/exploration_pb2.py. Please make sure the changes are verified by the previous codeowner(s) of the file. Thanks!

@oppiabot oppiabot bot added the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Jul 19, 2021
@oppiabot
Copy link

oppiabot bot commented Jul 19, 2021

Hi @anandwana001, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks!

@oppiabot oppiabot bot removed the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Jul 19, 2021
@oppiabot
Copy link

oppiabot bot commented Jul 19, 2021

Hi @DubeySandeep, this PR adds a new code owner, @anandwana001 to the following files /core/domain/exploration.proto, /core/domain/exploration_pb2.py. Please make sure the changes are verified by the previous codeowner(s) of the file. Thanks!

@oppiabot
Copy link

oppiabot bot commented Jul 19, 2021

Hi @anandwana001. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@oppiabot
Copy link

oppiabot bot commented Jul 20, 2021

Hi @anandwana001, when creating WIP/Draft PRs, ensure that your commit messages are prefixed with [ci skip] or [skip ci] to prevent CI checks from running. You can learn more about it here.

1 similar comment
@oppiabot
Copy link

oppiabot bot commented Jul 20, 2021

Hi @anandwana001, when creating WIP/Draft PRs, ensure that your commit messages are prefixed with [ci skip] or [skip ci] to prevent CI checks from running. You can learn more about it here.

@oppiabot oppiabot bot added the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Jul 23, 2021
@oppiabot
Copy link

oppiabot bot commented May 24, 2022

Hi @anandwana001, there is a new change in develop which needs to be in your PR. Please update your branch with the latest changes in develop. For instructions, refer to this link. Thanks!

@oppiabot
Copy link

oppiabot bot commented May 31, 2022

Hi @anandwana001, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 4 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale label May 31, 2022
@oppiabot oppiabot bot removed stale PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. labels Jun 1, 2022
@anandwana001
Copy link
Contributor Author

@vojtechjelinek I had added this new job as per our discussion. VerifyExplorationMigrationJob.

  1. fetch_explorationv - It will fetch all the exploration models. and output under EXPLORATION PROCESSED $COUNT
  2. count_exploration - It suppose to get the count of exploration based on True and False, but I am facing a bit issue to implement how to output the number base on the True/False comparison I had added.

@oppiabot
Copy link

oppiabot bot commented Jun 2, 2022

Hi @anandwana001. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@vojtechjelinek
Copy link
Member

@vojtechjelinek I had added this new job as per our discussion. VerifyExplorationMigrationJob.

1. `fetch_explorationv` - It will fetch all the exploration models. and output under `EXPLORATION PROCESSED $COUNT`

2. `count_exploration` - It suppose to get the count of exploration based on True and False, but I am facing a bit issue to implement how to output the number base on the True/False comparison I had added.

For the missing field instead of returning False you can just return results.Err and that should count it correctly.

@oppiabot oppiabot bot added the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Jun 3, 2022
@oppiabot
Copy link

oppiabot bot commented Jun 3, 2022

Hi @anandwana001, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks!

@vojtechjelinek vojtechjelinek removed their assignment Jun 9, 2022
@oppiabot oppiabot bot removed the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Jun 14, 2022
@anandwana001
Copy link
Contributor Author

@vojtechjelinek I had added this new job as per our discussion. VerifyExplorationMigrationJob.

1. `fetch_explorationv` - It will fetch all the exploration models. and output under `EXPLORATION PROCESSED $COUNT`

2. `count_exploration` - It suppose to get the count of exploration based on True and False, but I am facing a bit issue to implement how to output the number base on the True/False comparison I had added.

For the missing field instead of returning False you can just return results.Err and that should count it correctly.

Done, please let me know if it works now?

@oppiabot oppiabot bot added the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Jun 16, 2022
@oppiabot
Copy link

oppiabot bot commented Jun 16, 2022

Hi @anandwana001, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks!

Copy link
Member

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

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

THanks! Took a pass.

Comment on lines +94 to +104
hasAttributes = True
else:
hasAttributes = False
except Exception as e:
logging.exception(e)
return result.Err((exp_id, e))

if hasAttributes:
return result.Ok((exp_id, hasAttributes))
else:
return result.Err((exp_id, e))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
hasAttributes = True
else:
hasAttributes = False
except Exception as e:
logging.exception(e)
return result.Err((exp_id, e))
if hasAttributes:
return result.Ok((exp_id, hasAttributes))
else:
return result.Err((exp_id, e))
return result.Ok((exp_id, hasAttributes))
else:
return result.Err((exp_id, e))
except Exception as e:
logging.exception(e)
return result.Err((exp_id, e))

Comment on lines +171 to +173
{
'exploration_boolean_list': exploration_boolean_list
}
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you pass just exploration_boolean_list?


return (
(

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

exploration_objects_list_job_run_results = (
exploration_objects_list
| 'Transform exploration objects into job run results' >> (
job_result_transforms.CountObjectsToJobRunResult(
Copy link
Member

Choose a reason for hiding this comment

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

Why don'ŧ you also use ResultsToJobRunResults here (I know that you may need to change some stuff above)?

@oppiabot
Copy link

oppiabot bot commented Jun 17, 2022

Unassigning @vojtechjelinek since the review is done.

@oppiabot
Copy link

oppiabot bot commented Jun 20, 2022

Hi @anandwana001, there is a new change in develop which needs to be in your PR. Please update your branch with the latest changes in develop. For instructions, refer to this link. Thanks!

@oppiabot
Copy link

oppiabot bot commented Jun 27, 2022

Hi @anandwana001, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 4 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale label Jun 27, 2022
@oppiabot oppiabot bot closed this Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Affects datastore layer Labels to indicate a PR that changes the datastore layer. PR: don't merge - HAS MERGE CONFLICTS PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. stale
Projects
None yet