예제 #1
0
    def _walk_releases(self):
        """Traverse all of the releases in this project's repository and process
        each one matching our tag (not draft/prerelease) to generate the data dictionary."""
        repo = self.get_repo()

        for release in repo.releases():
            # Skip this release if any are true:
            # It is a draft release
            # It is prerelease (managed beta)
            # This release's tag does not have the expected prefix,
            # meaning we don't know its version number
            if (release.draft or release.prerelease
                    or not release.tag_name.startswith(
                        self.options["release_prefix"])):
                continue

            zip_file = download_extract_github_from_repo(repo,
                                                         ref=release.tag_name)
            version = self._version_from_tag_name(release.tag_name)
            self.logger.info(f"Analyzing version {version}")

            if "src/objects/" in zip_file.namelist():
                # MDAPI format
                self._process_mdapi_release(zip_file, version)

            if "force-app/main/default/objects/" in zip_file.namelist():
                # FIXME: check sfdx-project.json for directories to process.
                # SFDX format
                self._process_sfdx_release(zip_file, version)
예제 #2
0
 def _download_repo_and_extract(self, path):
     zf = download_extract_github_from_repo(self.get_repo(), ref=self.ref)
     included_members = self._filter_namelist(
         includes=self.options["include"], namelist=zf.namelist()
     )
     zf.extractall(path=path, members=included_members)