Allow to specify default branch for repos
By default Stackalytics processes commits from master branch, but for 3rd-party projects that may not work. Allow to set which branch needs to be used. Closes bug 1434533 Change-Id: I0a0b7e610a807c643e391535784824bd8328e54a
This commit is contained in:
@@ -12341,6 +12341,24 @@
|
|||||||
"module": "jcloud",
|
"module": "jcloud",
|
||||||
"organization": "jcloud",
|
"organization": "jcloud",
|
||||||
"uri": "https://github.com/jclouds/jclouds.git"
|
"uri": "https://github.com/jclouds/jclouds.git"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "ansible",
|
||||||
|
"organization": "ansible",
|
||||||
|
"uri": "https://github.com/ansible/ansible.git",
|
||||||
|
"default_branch": "devel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "ansible-modules-core",
|
||||||
|
"organization": "ansible",
|
||||||
|
"uri": "https://github.com/ansible/ansible-modules-core.git",
|
||||||
|
"default_branch": "devel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "ansible-modules-extras",
|
||||||
|
"organization": "ansible",
|
||||||
|
"uri": "https://github.com/ansible/ansible-modules-extras.git",
|
||||||
|
"default_branch": "devel"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"project_sources": [
|
"project_sources": [
|
||||||
@@ -12363,10 +12381,6 @@
|
|||||||
{
|
{
|
||||||
"organization": "cloudfoundry",
|
"organization": "cloudfoundry",
|
||||||
"uri": "github://"
|
"uri": "github://"
|
||||||
},
|
|
||||||
{
|
|
||||||
"organization": "ansible",
|
|
||||||
"uri": "github://"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"module_groups": [
|
"module_groups": [
|
||||||
|
@@ -110,6 +110,9 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"default_branch": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["uri", "module", "organization"],
|
"required": ["uri", "module", "organization"],
|
||||||
@@ -167,6 +170,9 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"default_branch": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["organization"],
|
"required": ["organization"],
|
||||||
|
@@ -84,7 +84,7 @@ show_record_type=True, show_user_gravatar=True, gravatar_size=32, show_all=True)
|
|||||||
{%if record_type == "commit" %}
|
{%if record_type == "commit" %}
|
||||||
<div class="header">Commit “${subject}”</div>
|
<div class="header">Commit “${subject}”</div>
|
||||||
<div class="message">{%html message %}</div>
|
<div class="message">{%html message %}</div>
|
||||||
{%if commit_date_str != "" %}
|
{%if commit_date_str != "" && commit_date_str != date_str %}
|
||||||
<div>Commit date: ${commit_date_str}</div>
|
<div>Commit date: ${commit_date_str}</div>
|
||||||
{%/if%}
|
{%/if%}
|
||||||
{%if correction_comment != "" %}
|
{%if correction_comment != "" %}
|
||||||
|
@@ -114,7 +114,7 @@ def _retrieve_project_list_from_github(project_source):
|
|||||||
|
|
||||||
for repo in github_repos:
|
for repo in github_repos:
|
||||||
yield {
|
yield {
|
||||||
'branches': ['master'],
|
'branches': [project_source.get('default_branch', 'master')],
|
||||||
'module': repo.name.lower(),
|
'module': repo.name.lower(),
|
||||||
'organization': organization,
|
'organization': organization,
|
||||||
'uri': repo.git_url,
|
'uri': repo.git_url,
|
||||||
|
@@ -85,7 +85,7 @@ def import_data(memcached_inst, fd):
|
|||||||
def get_repo_keys(memcached_inst):
|
def get_repo_keys(memcached_inst):
|
||||||
for repo in (memcached_inst.get('repos') or []):
|
for repo in (memcached_inst.get('repos') or []):
|
||||||
uri = repo['uri']
|
uri = repo['uri']
|
||||||
branches = set(['master'])
|
branches = {repo.get('default_branch', 'master')}
|
||||||
for release in repo.get('releases'):
|
for release in repo.get('releases'):
|
||||||
if 'branch' in release:
|
if 'branch' in release:
|
||||||
branches.add(release['branch'])
|
branches.add(release['branch'])
|
||||||
|
@@ -119,7 +119,7 @@ def _process_repo(repo, runtime_storage_inst, record_processor_inst,
|
|||||||
vcs_inst = vcs.get_vcs(repo, cfg.CONF.sources_root)
|
vcs_inst = vcs.get_vcs(repo, cfg.CONF.sources_root)
|
||||||
vcs_inst.fetch()
|
vcs_inst.fetch()
|
||||||
|
|
||||||
branches = set(['master'])
|
branches = {repo.get('default_branch', 'master')}
|
||||||
for release in repo.get('releases'):
|
for release in repo.get('releases'):
|
||||||
if 'branch' in release:
|
if 'branch' in release:
|
||||||
branches.add(release['branch'])
|
branches.add(release['branch'])
|
||||||
|
Reference in New Issue
Block a user