Resolve TODOs under Shicong's name (#930)

This commit is contained in:
Shicong Huang 2021-01-15 14:22:31 -05:00 committed by GitHub
parent 76af708871
commit 2e86f30a5e
12 changed files with 14 additions and 29 deletions

View file

@ -600,7 +600,6 @@ task compileProdJS(type: JavaExec) {
closureArgs << "--js=${jsDir}/soyutils_usegoog.js" closureArgs << "--js=${jsDir}/soyutils_usegoog.js"
closureArgs << "--js=${cssSourceDir}/registrar_bin.css.js" closureArgs << "--js=${cssSourceDir}/registrar_bin.css.js"
closureArgs << "--js=${jsSourceDir}/**.js" closureArgs << "--js=${jsSourceDir}/**.js"
// TODO(shicong) Verify the compiled JS file works in Alpha
closureArgs << "--js=${externsDir}/json.js" closureArgs << "--js=${externsDir}/json.js"
closureArgs << "--js=${soySourceDir}/**.js" closureArgs << "--js=${soySourceDir}/**.js"
args closureArgs args closureArgs

View file

@ -193,19 +193,6 @@ public class GracePeriod extends GracePeriodBase implements DatastoreAndSqlEntit
return clone; return clone;
} }
/**
* Returns a clone of this {@link GracePeriod} with prepopulated {@link #gracePeriodId} generated
* by {@link ObjectifyService#allocateId()}.
*
* <p>TODO(shicong): Figure out how to generate the id only when the entity is used for Cloud SQL.
*/
@VisibleForTesting
public GracePeriod cloneWithPrepopulatedId() {
GracePeriod clone = clone(this);
clone.gracePeriodId = ObjectifyService.allocateId();
return clone;
}
/** Entity class to represent a historic {@link GracePeriod}. */ /** Entity class to represent a historic {@link GracePeriod}. */
@Entity(name = "GracePeriodHistory") @Entity(name = "GracePeriodHistory")
@Table(indexes = @Index(columnList = "domainRepoId")) @Table(indexes = @Index(columnList = "domainRepoId"))

View file

@ -35,7 +35,7 @@ import javax.xml.bind.annotation.XmlType;
* *
* @see <a href="http://tools.ietf.org/html/rfc5910">RFC 5910</a> * @see <a href="http://tools.ietf.org/html/rfc5910">RFC 5910</a>
* @see <a href="http://tools.ietf.org/html/rfc4034">RFC 4034</a> * @see <a href="http://tools.ietf.org/html/rfc4034">RFC 4034</a>
* <p>TODO(shicong): Rename this class to DomainDsData. * <p>TODO(b/177567432): Rename this class to DomainDsData.
*/ */
@Embed @Embed
@XmlType(name = "dsData") @XmlType(name = "dsData")

View file

@ -59,8 +59,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
public class Address extends ImmutableObject implements Jsonifiable { public class Address extends ImmutableObject implements Jsonifiable {
/** The schema validation will enforce that this has 3 lines at most. */ /** The schema validation will enforce that this has 3 lines at most. */
// TODO(shicong): Remove this field after migration. We need to figure out how to generate same // TODO(b/177569726): Remove this field after migration. We need to figure out how to generate
// XML from streetLine[1,2,3]. // same XML from streetLine[1,2,3].
@XmlJavaTypeAdapter(NormalizedStringAdapter.class) @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
@Transient @Transient
List<String> street; List<String> street;

View file

@ -234,7 +234,7 @@ public class Registrar extends ImmutableObject
* Unique registrar client id. Must conform to "clIDType" as defined in RFC5730. * Unique registrar client id. Must conform to "clIDType" as defined in RFC5730.
* *
* @see <a href="http://tools.ietf.org/html/rfc5730#section-4.2">Shared Structure Schema</a> * @see <a href="http://tools.ietf.org/html/rfc5730#section-4.2">Shared Structure Schema</a>
* <p>TODO(shicong): Rename this field to clientId * <p>TODO(b/177568946): Rename this field to registrarId.
*/ */
@Id @Id
@javax.persistence.Id @javax.persistence.Id

View file

@ -58,7 +58,7 @@ public class ClaimsListDao {
/** /**
* Returns the most recent revision of the {@link ClaimsListShard} in Cloud SQL, if it exists. * Returns the most recent revision of the {@link ClaimsListShard} in Cloud SQL, if it exists.
* TODO(shicong): Change this method to package level access after dual-read phase. * TODO(b/177569979): Change this method to package level access after dual-read phase.
* ClaimsListShard uses this method to retrieve claims list in Cloud SQL for the comparison, and * ClaimsListShard uses this method to retrieve claims list in Cloud SQL for the comparison, and
* ClaimsListShard is not in this package. * ClaimsListShard is not in this package.
*/ */

View file

@ -69,7 +69,7 @@ public abstract class TransferData<
Set<VKey<? extends TransferServerApproveEntity>> serverApproveEntities; Set<VKey<? extends TransferServerApproveEntity>> serverApproveEntities;
// The following 3 fields are the replacement for serverApproveEntities in Cloud SQL. // The following 3 fields are the replacement for serverApproveEntities in Cloud SQL.
// TODO(shicong): Add getter/setter for these 3 fields and use them in the application code. // TODO(b/177589157): Make transfer flows work with Cloud SQL.
@Ignore @Ignore
@Column(name = "transfer_gaining_poll_message_id") @Column(name = "transfer_gaining_poll_message_id")
Long gainingTransferPollMessageId; Long gainingTransferPollMessageId;

View file

@ -351,8 +351,8 @@ public abstract class PersistenceModule {
@interface BeamPipelineCloudSqlConfigs {} @interface BeamPipelineCloudSqlConfigs {}
/** Dagger qualifier for the default Hibernate configurations. */ /** Dagger qualifier for the default Hibernate configurations. */
// TODO(shicong): Change annotations in this class to none public or put them in a top level // TODO(b/177568911): Change annotations in this class to none public or put them in a top level
// package // package.
@Qualifier @Qualifier
@Documented @Documented
public @interface DefaultHibernateConfigs {} public @interface DefaultHibernateConfigs {}

View file

@ -20,7 +20,6 @@ import javax.persistence.Converter;
/** /**
* JPA {@link AttributeConverter} for storing/retrieving {@code List<CidrAddressBlock>} objects. * JPA {@link AttributeConverter} for storing/retrieving {@code List<CidrAddressBlock>} objects.
* TODO(shicong): Investigate if we can have one converter for any List type
*/ */
@Converter(autoApply = true) @Converter(autoApply = true)
public class CidrAddressBlockListConverter extends StringListConverterBase<CidrAddressBlock> { public class CidrAddressBlockListConverter extends StringListConverterBase<CidrAddressBlock> {

View file

@ -76,8 +76,9 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
// EntityManagerFactory is thread safe. // EntityManagerFactory is thread safe.
private final EntityManagerFactory emf; private final EntityManagerFactory emf;
private final Clock clock; private final Clock clock;
// TODO(shicong): Investigate alternatives for managing transaction information. ThreadLocal adds // TODO(b/177588434): Investigate alternatives for managing transaction information. ThreadLocal
// an unnecessary restriction that each request has to be processed by one thread synchronously. // adds an unnecessary restriction that each request has to be processed by one thread
// synchronously.
private final ThreadLocal<TransactionInfo> transactionInfo = private final ThreadLocal<TransactionInfo> transactionInfo =
ThreadLocal.withInitial(TransactionInfo::new); ThreadLocal.withInitial(TransactionInfo::new);

View file

@ -221,8 +221,7 @@ public class DomainHistoryTest extends EntityTestCase {
.setGracePeriods( .setGracePeriods(
ImmutableSet.of( ImmutableSet.of(
GracePeriod.create( GracePeriod.create(
GracePeriodStatus.ADD, "domainRepoId", END_OF_TIME, "clientId", null) GracePeriodStatus.ADD, "domainRepoId", END_OF_TIME, "clientId", null)))
.cloneWithPrepopulatedId()))
.build(); .build();
} }

View file

@ -48,8 +48,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
* Unit tests for SQL only APIs defined in {@link JpaTransactionManagerImpl}. Note that the tests * Unit tests for SQL only APIs defined in {@link JpaTransactionManagerImpl}. Note that the tests
* for common APIs in {@link TransactionManager} are added in {@link TransactionManagerTest}. * for common APIs in {@link TransactionManager} are added in {@link TransactionManagerTest}.
* *
* <p>TODO(shicong): Remove duplicate tests that covered by TransactionManagerTest by refactoring * <p>TODO(b/177587763): Remove duplicate tests that covered by TransactionManagerTest by
* the test schema. * refactoring the test schema.
*/ */
class JpaTransactionManagerImplTest { class JpaTransactionManagerImplTest {