Skip to content
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

Tech Debt: Test if loading an item from a dependency duplicates and overwrites existing key #26

Open
gregelin opened this issue Oct 18, 2016 · 0 comments

Comments

@gregelin
Copy link

gregelin commented Oct 18, 2016

See TODO in code below in systemcompliance.py. Code loads a remote reference listed in a dependency but does not check if the key is duplicated and therefore overwrites content.

      # load dependencies
      for item_type in self.supported_dictionaries:
        # get standards in dependencies
        for dependency_item in ocf.list_dependency_items_in_repo(ocf.resolve_ocfile_url(repo_url, revision), item_type):
          # print("******** dependency_item ******\n", dependency_item)
          dependency_ocf =  OpenControlFiles()
          dependency_repo_url = dependency_item['url']
          # print("******** dependency_repo_url ******\n", dependency_repo_url)
          dependency_revision = dependency_item['revision']
          # print("******** resolved dependency *******\n", dependency_ocf.resolve_ocfile_url(dependency_repo_url.strip("/"), dependency_revision))
          for url in dependency_ocf.list_items_urls_in_repo(dependency_ocf.resolve_ocfile_url(dependency_repo_url.strip("/"), dependency_revision), item_type):
            print("*** Reading dependencies %s %s" % (item_type, url))
            # TODO test if we will end duplicating and overwriting existing key
            self.add_system_dict_from_url(item_type, url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant