-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Objectify v6 compatibility testing #11016
Comments
|
Using Testing Approach 2: Backward:
Forward:
|
Approach 2: (backward - test on v5 data) env: Error:
UPDATE:
|
Both errors seem to suggest that the data in the datastore might be in a format incompatible with the intended pojo field. I think it might be because currently we don't have any logic implemented to translate |
Backward compatibility test env: Backend exceptions:
Failed tests: (28)
Relevant code: // GetStudentAction.java
private static final String UNAUTHORIZED_ACCESS = "You are not allowed to view this resource!";
@Override
void checkSpecificAccessControl() {
String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID);
CourseAttributes course = logic.getCourse(courseId);
StudentAttributes student;
String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL);
String regKey = getRequestParamValue(Const.ParamsNames.REGKEY);
if (studentEmail != null) {
student = logic.getStudentForEmail(courseId, studentEmail);
if (student == null || userInfo == null || !userInfo.isInstructor) {
throw new UnauthorizedAccessException(UNAUTHORIZED_ACCESS);
}
InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id);
gateKeeper.verifyAccessible(instructor, logic.getCourse(courseId), student.section,
Const.InstructorPermissions.CAN_VIEW_STUDENT_IN_SECTIONS);
} else if (regKey != null) {
getUnregisteredStudent().orElseThrow(() -> new UnauthorizedAccessException(UNAUTHORIZED_ACCESS));
} else {
if (userInfo == null || !userInfo.isStudent) {
throw new UnauthorizedAccessException(UNAUTHORIZED_ACCESS);
}
student = logic.getStudentForGoogleId(courseId, userInfo.id);
gateKeeper.verifyAccessible(student, course);
}
} // GetCourseAction.java
@Override
void checkSpecificAccessControl() {
String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE);
if (!((entityType.equals(Const.EntityType.STUDENT) && userInfo.isStudent)
|| (entityType.equals(Const.EntityType.INSTRUCTOR) && userInfo.isInstructor))) {
throw new UnauthorizedAccessException("Current account cannot access to courses of request entity type");
}
} // GateKeeper.java
public void verifyAccessible(InstructorAttributes instructor, CourseAttributes course) {
verifyNotNull(instructor, "instructor");
verifyNotNull(instructor.courseId, "instructor's course ID");
verifyNotNull(course, "course");
verifyNotNull(course.getId(), "course ID");
if (!instructor.courseId.equals(course.getId())) {
throw new UnauthorizedAccessException("Course [" + course.getId() + "] is not accessible to instructor ["
+ instructor.email + "]");
}
} |
Work is done |
Environment:
release
branchobjectify-v6-migration
branchTesting approach 1: connect dev server to the staging server datastore
build.properties
the attributeapp.production.gcs.bucketname=tm-obj-v6-test.appspot.com
contextInitialized
inOfyHelper
as below:setupLocalDatastoreHelper
andtearDownLocalDatastoreHelper
inBaseE2ETestCase
classTesting approach 2: export data from staging data buckets and import into emulator
gsutil -m cp -r "gs://v6_migration_db/2021-03-06T13:53:55_30312/" <dst_url>
gcloud beta emulators datastore start --host-port=localhost:8484 --consistency=1.0
input_url
path.The text was updated successfully, but these errors were encountered: