diff --git a/etc/refstack.conf.sample b/etc/refstack.conf.sample index 65b78fd3..6edcd194 100644 --- a/etc/refstack.conf.sample +++ b/etc/refstack.conf.sample @@ -144,19 +144,19 @@ # Template for test result url. (string value) #test_results_url = /#/results/%s -# The GitHub API URL of the repository and location of the +# The opendev API URL of the repository and location of the # Interop Working Group capability files. # This URL is used to get a listing of all capability files. (string value) -#github_api_capabilities_url = https://api.github.com/repos/openstack/interop/contents +#opendev_api_capabilities_url = https://opendev.org/api/v1/repos/osf/interop/contents -# The GitHub API URL of the repository and location of any additional +# The opendev API URL of the repository and location of any additional # guideline sources which will need to be parsed by the refstack API. -#additional_capability_urls = https://api.github.com/repos/openstack/interop/contents/add-ons +#additional_capability_urls = https://opendev.org/api/v1/repos/osf/interop/contents/add-ons # This is the base URL that is used for retrieving specific capability # files. Capability file names will be appended to this URL to get the # contents of that file. (string value) -#github_raw_base_url = https://raw.githubusercontent.com/openstack/interop/master/ +#opendev_raw_base_url = https://opendev.org/api/v1/repos/osf/interop/raw/ # Enable or disable anonymous uploads. If set to False, all clients # will need to authenticate and sign with a public/private keypair diff --git a/refstack/api/app.py b/refstack/api/app.py index b43bcf68..3b213557 100644 --- a/refstack/api/app.py +++ b/refstack/api/app.py @@ -80,22 +80,20 @@ API_OPTS = [ default='/#/results/%s', help='Template for test result url.' ), - cfg.StrOpt('github_api_capabilities_url', - default='https://api.github.com' - '/repos/openstack/interop/contents', + cfg.StrOpt('opendev_api_capabilities_url', + default='https://opendev.org/api/v1/repos/osf/interop/contents', help='The GitHub API URL of the repository and location of the ' 'Interop Working Group capability files. This URL is used ' 'to get a listing of all capability files.' ), cfg.StrOpt('additional_capability_urls', - default='https://api.github.com' - '/repos/openstack/interop/contents/add-ons', + default='https://opendev.org/api/v1/' + 'repos/osf/interop/contents/add-ons', help=('The GitHub API URL of the repository and location of ' 'any additional guideline sources which will need to ' 'be parsed by the refstack API.')), - cfg.StrOpt('github_raw_base_url', - default='https://raw.githubusercontent.com' - '/openstack/interop/master/', + cfg.StrOpt('opendev_raw_base_url', + default='https://opendev.org/api/v1/repos/osf/interop/raw/', help='This is the base URL that is used for retrieving ' 'specific capability files. Capability file names will ' 'be appended to this URL to get the contents of that file.' diff --git a/refstack/api/guidelines.py b/refstack/api/guidelines.py index 5fba7288..2ac10bf6 100755 --- a/refstack/api/guidelines.py +++ b/refstack/api/guidelines.py @@ -27,7 +27,7 @@ CONF = cfg.CONF LOG = log.getLogger(__name__) # Cached requests will expire after 12 hours. -requests_cache.install_cache(cache_name='github_cache', +requests_cache.install_cache(cache_name='opendev_cache', backend='memory', expire_after=43200) @@ -56,13 +56,13 @@ class Guidelines: if repo_url: self.repo_url = repo_url else: - self.repo_url = CONF.api.github_api_capabilities_url + self.repo_url = CONF.api.opendev_api_capabilities_url if self.repo_url and self.repo_url not in self.guideline_sources: self.guideline_sources.append(self.repo_url) if raw_url: self.raw_url = raw_url else: - self.raw_url = CONF.api.github_raw_base_url + self.raw_url = CONF.api.opendev_raw_base_url def get_guideline_list(self): """Return a list of a guideline files.