Skip to content
Snippets Groups Projects

metadata_dictionary: Deduplicate extension-based file detection

1 unresolved thread

Deduplicate extension-based file detection using SingleFileIntrinsicMapping.

There were some instances where it was missing and some where it wasn't inherited properly. Furthermore, updated detect_metadata_files to support regex in filename.

Edited by Kumar Shivendu

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
132 132 """Base class for all intrinsic metadata mappings that use a single file as input."""
133 133
134 134 @property
135 def filename(self):
135 def filename(self) -> bytes:
136 136 """The .json file to extract metadata from."""
137 137 raise NotImplementedError(f"{self.__class__.__name__}.filename")
138 138
139 139 @classmethod
140 140 def detect_metadata_files(cls, file_entries: List[DirectoryLsEntry]) -> List[Sha1]:
141 for entry in file_entries:
142 if entry["name"].lower() == cls.filename:
143 return [entry["sha1"]]
141 filename: bytes = cls.filename # type: ignore
  • Kumar Shivendu
  • Jenkins job DCIDX/gitlab-builds #11 succeeded .
    See Console Output and Coverage Report for more details.

  • Author Contributor

    @vlorentz requesting your review on this :)

  • vlorentz
  • Please change your title, it's vague and doesn't match the content very well IMO (and usage implies it's not a refactoring).

    Also, we don't use fix: or feat: prefixes.

    How about this: metadata_dictionary: Deduplicate extension-based file detection?

  • Kumar Shivendu added 1 commit

    added 1 commit

    • 7df846a9 - metadata_dictionary: Deduplicate extension-based file detection

    Compare with previous version

  • Kumar Shivendu changed title from fix: Improve SingleFileIntrinsicMapping implementation and usage to metadata_dictionary: Deduplicate extension-based file detection

    changed title from fix: Improve SingleFileIntrinsicMapping implementation and usage to metadata_dictionary: Deduplicate extension-based file detection

  • Kumar Shivendu changed the description

    changed the description

  • Jenkins job DCIDX/gitlab-builds #18 failed .
    See Console Output and Coverage Report for more details.

  • vlorentz
  • Kumar Shivendu added 1 commit

    added 1 commit

    • 8138804f - metadata_dictionary: Declare filename as an attribute to fix mypy failure

    Compare with previous version

  • Jenkins job DCIDX/gitlab-builds #19 failed .
    See Console Output and Coverage Report for more details.

  • Kumar Shivendu added 4 commits

    added 4 commits

    • 8138804f...0cc2a326 - 2 commits from branch swh/devel:master
    • 57b79680 - metadata_dictionary: Deduplicate extension-based file detection
    • 3007c898 - metadata_dictionary: Declare filename as an attribute to fix mypy failure

    Compare with previous version

  • Jenkins job DCIDX/gitlab-builds #20 succeeded .
    See Console Output and Coverage Report for more details.

  • Kumar Shivendu mentioned in merge request !482

    mentioned in merge request !482

  • merged

  • Please register or sign in to reply
    Loading