Page MenuHomeSoftware Heritage

Rename 'type' field to 'targetType' in the schema
ClosedPublic

Authored by jayeshv on Sep 5 2022, 2:49 PM.

Details

Summary

'target type' is called 'type' in sanpshot branch, search and directoy entry
objects. This is inconsistent with the field name used in the release object.
Change all the field names representing the type of a target to 'targetType'.

Related to T4492

Diff Detail

Repository
rDGQL GraphQL API
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D8389 (id=30281)

Rebasing onto 6b1c5797f7...

Current branch diff-target is up to date.
Changes applied before test
commit 467e0b7e28bcdf2eb627db01c8268cabb1c42012
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Mon Sep 5 10:06:35 2022 +0200

    Rename 'type' field to 'targetType' in the schema
    
    'target type' is called 'type' in sanpshot branch, search and directoy entry
    objects. This is inconsistent with the field name used in the release object.
    Change all the field names representing the type of a target to 'targetType'.
    
    Related to T4492

See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/149/ for more details.

anlambert added inline comments.
swh/graphql/schema/schema.graphql
724

The DirectoryEntry model does not name that field target_type but simply type so I think we should remain aligned with it.

swh/graphql/schema/schema.graphql
724

Will not that be an inconsistency in the API level? it will be called 'targetType' everywhere and just 'type' here?
We can decide either way.

anlambert added inline comments.
swh/graphql/schema/schema.graphql
724

Yes thinking it back, this looks like a mistake in the model, it should have been renamed to target_type for consistency.

Looks good to me then.

This revision is now accepted and ready to land.Sep 5 2022, 3:44 PM