Skip to content

Commit

Permalink
Merge pull request #2171 from chaoss/main-merge
Browse files Browse the repository at this point in the history
Release 0.44.0
  • Loading branch information
sgoggins committed Feb 14, 2023
2 parents adb0e2b + fe2d1d4 commit 9fb55e7
Show file tree
Hide file tree
Showing 199 changed files with 17,580 additions and 6,155 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -7,6 +7,8 @@ augur_export_env.sh
.DS_Store
*.config.json
!docker.config.json
config.yml
reports.yml


node_modules/
Expand Down
7 changes: 5 additions & 2 deletions README.md
@@ -1,12 +1,15 @@
# Augur NEW Release v0.43.10

# Augur NEW Release v0.44.0

[![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://www.firsttimersonly.com/) We follow the [First Timers Only](https://www.firsttimersonly.com/) philosophy of tagging issues for first timers only, and walking one newcomer through the resolution process weekly. [You can find these issues tagged with "first timers only" on our issues list.](https://github.com/chaoss/augur/labels/first-timers-only).

[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) [![Build Docker images](https://github.com/chaoss/augur/actions/workflows/build_docker.yml/badge.svg)](https://github.com/chaoss/augur/actions/workflows/build_docker.yml) [![Hits-of-Code](https://hitsofcode.com/github/chaoss/augur?branch=main)](https://hitsofcode.com/github/chaoss/augur/view?branch=main) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2788/badge)](https://bestpractices.coreinfrastructure.org/projects/2788)

## NEW RELEASE ALERT!
[If you want to jump right in, updated docker build/compose and bare metal installation instructions are available here](docs/new-install.md)

Augur is now releasing a dramatically improved new version to the main branch. It is also available here: https://github.com/chaoss/augur/releases/tag/v0.43.10

Augur is now releasing a dramatically improved new version to the main branch. It is also available here: https://github.com/chaoss/augur/releases/tag/v0.44.0
- The `main` branch is a stable version of our new architecture, which features:
- Dramatic improvement in the speed of large scale data collection (10,000+ repos). All data is obtained for 10k+ repos within a week
- A new job management architecture that uses Celery and Redis to manage queues, and enables users to run a Flower job monitoring dashboard
Expand Down
24 changes: 14 additions & 10 deletions augur/api/gunicorn_conf.py
Expand Up @@ -6,9 +6,13 @@
import shutil

from augur.application.db.session import DatabaseSession
from augur.application.config import AugurConfig

logger = logging.getLogger(__name__)
with DatabaseSession(logger) as session:

augur_config = AugurConfig(logger, session)


# ROOT_AUGUR_DIRECTORY = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))

Expand All @@ -21,21 +25,21 @@
reload = True

# set the log location for gunicorn
logs_directory = session.config.get_value('Logging', 'logs_directory')
logs_directory = augur_config.get_value('Logging', 'logs_directory')
accesslog = f"{logs_directory}/gunicorn.log"
errorlog = f"{logs_directory}/gunicorn.log"

ssl_bool = session.config.get_value('Server', 'ssl')
ssl_bool = augur_config.get_value('Server', 'ssl')

if ssl_bool is True:

workers = int(session.config.get_value('Server', 'workers'))
bind = '%s:%s' % (session.config.get_value("Server", "host"), session.config.get_value("Server", "port"))
timeout = int(session.config.get_value('Server', 'timeout'))
certfile = str(session.config.get_value('Server', 'ssl_cert_file'))
keyfile = str(session.config.get_value('Server', 'ssl_key_file'))
workers = int(augur_config.get_value('Server', 'workers'))
bind = '%s:%s' % (augur_config.get_value("Server", "host"), augur_config.get_value("Server", "port"))
timeout = int(augur_config.get_value('Server', 'timeout'))
certfile = str(augur_config.get_value('Server', 'ssl_cert_file'))
keyfile = str(augur_config.get_value('Server', 'ssl_key_file'))

else:
workers = int(session.config.get_value('Server', 'workers'))
bind = '%s:%s' % (session.config.get_value("Server", "host"), session.config.get_value("Server", "port"))
timeout = int(session.config.get_value('Server', 'timeout'))
workers = int(augur_config.get_value('Server', 'workers'))
bind = '%s:%s' % (augur_config.get_value("Server", "host"), augur_config.get_value("Server", "port"))
timeout = int(augur_config.get_value('Server', 'timeout'))
7 changes: 4 additions & 3 deletions augur/api/metrics/commit.py
Expand Up @@ -8,8 +8,7 @@
import pandas as pd
from augur.api.util import register_metric

from augur.application.db.engine import create_database_engine
engine = create_database_engine()
from ..server import engine

@register_metric()
def committers(repo_group_id, repo_id=None, begin_date=None, end_date=None, period='month'):
Expand Down Expand Up @@ -167,6 +166,7 @@ def annual_commit_count_ranked_by_new_repo_in_repo_group(repo_group_id, repo_id=
GROUP BY repo.repo_id, repo_name, YEAR
ORDER BY YEAR ASC
""".format(table, period))

results = pd.read_sql(cdRgNewrepRankedCommitsSQL, engine, params={'repo_id': repo_id,
'repo_group_id': repo_group_id,'begin_date': begin_date, 'end_date': end_date})
return results
Expand Down Expand Up @@ -310,6 +310,7 @@ def top_committers(repo_group_id, repo_id=None, year=None, threshold=0.8):

results = pd.read_sql(total_commits_SQL, engine,
params={'year': year, 'repo_id': repo_id})

if not results.iloc[0]['sum']:
return pd.DataFrame()

Expand Down Expand Up @@ -353,7 +354,7 @@ def top_committers(repo_group_id, repo_id=None, year=None, threshold=0.8):
""")

results = pd.read_sql(committers_SQL, engine,
params={'year': year, 'repo_id': repo_id})
params={'year': year, 'repo_id': repo_id})

cumsum = 0
for i, row in results.iterrows():
Expand Down
11 changes: 5 additions & 6 deletions augur/api/metrics/contributor.py
Expand Up @@ -9,8 +9,7 @@
from augur.api.util import register_metric
import uuid

from augur.application.db.engine import create_database_engine
engine = create_database_engine()
from ..server import engine

@register_metric()
def contributors(repo_group_id, repo_id=None, period='day', begin_date=None, end_date=None):
Expand Down Expand Up @@ -43,7 +42,7 @@ def contributors(repo_group_id, repo_id=None, period='day', begin_date=None, end

if repo_id:
contributorsSQL = s.sql.text("""
SELECT id::text AS user_id,
SELECT id::text AS user_id,
SUM(commits) AS commits,
SUM(issues) AS issues,
SUM(commit_comments) AS commit_comments,
Expand Down Expand Up @@ -130,7 +129,7 @@ def contributors(repo_group_id, repo_id=None, period='day', begin_date=None, end
'begin_date': begin_date, 'end_date': end_date})
else:
contributorsSQL = s.sql.text("""
SELECT id::text AS user_id,
SELECT id::text AS user_id,
SUM(commits) AS commits,
SUM(issues) AS issues,
SUM(commit_comments) AS commit_comments,
Expand Down Expand Up @@ -213,7 +212,7 @@ def contributors(repo_group_id, repo_id=None, period='day', begin_date=None, end
""")

results = pd.read_sql(contributorsSQL, engine, params={'repo_group_id': repo_group_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
'begin_date': begin_date, 'end_date': end_date})
return results

@register_metric()
Expand Down Expand Up @@ -283,7 +282,7 @@ def contributors_new(repo_group_id, repo_id=None, period='day', begin_date=None,
""")

results = pd.read_sql(contributorsNewSQL, engine, params={'repo_id': repo_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
'begin_date': begin_date, 'end_date': end_date})
else:
contributorsNewSQL = s.sql.text("""
SELECT date_trunc(:period, b.created_at::DATE) AS date, COUNT(id) AS new_contributors, repo.repo_id, repo_name
Expand Down
3 changes: 1 addition & 2 deletions augur/api/metrics/deps.py
Expand Up @@ -7,8 +7,7 @@
import pandas as pd
from augur.api.util import register_metric

from augur.application.db.engine import create_database_engine
engine = create_database_engine()
from ..server import engine

@register_metric()
def deps(repo_group_id, repo_id=None, period='day', begin_date=None, end_date=None):
Expand Down
3 changes: 1 addition & 2 deletions augur/api/metrics/insight.py
Expand Up @@ -7,8 +7,7 @@
import pandas as pd
from augur.api.util import register_metric

from augur.application.db.engine import create_database_engine
engine = create_database_engine()
from ..server import engine

@register_metric(type="repo_group_only")
def top_insights(repo_group_id, num_repos=6):
Expand Down
63 changes: 31 additions & 32 deletions augur/api/metrics/issue.py
Expand Up @@ -8,8 +8,7 @@
import pandas as pd
from augur.api.util import register_metric

from augur.application.db.engine import create_database_engine
engine = create_database_engine()
from ..server import engine

@register_metric()
def issues_first_time_opened(repo_group_id, repo_id=None, period='day', begin_date=None, end_date=None):
Expand Down Expand Up @@ -78,8 +77,8 @@ def issues_first_time_opened(repo_group_id, repo_id=None, period='day', begin_da
ORDER BY issue_date
""")
results = pd.read_sql(issueNewContributor, engine,
params={'repo_group_id': repo_group_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
params={'repo_group_id': repo_group_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
return results

@register_metric()
Expand Down Expand Up @@ -124,7 +123,7 @@ def issues_first_time_closed(repo_group_id, repo_id=None, period='day', begin_da
'begin_date': begin_date, 'end_date': end_date})
else:
issuesClosedSQL = s.sql.text("""
SELECT date_trunc(:period, new_date::DATE) AS issue_date,
SELECT date_trunc(:period, new_date::DATE) AS issue_date,
COUNT(cntrb_id),
repo_name, repo_id
FROM (
Expand Down Expand Up @@ -181,7 +180,7 @@ def issues_new(repo_group_id, repo_id=None, period='day', begin_date=None, end_d
""")

results = pd.read_sql(issues_new_SQL, engine, params={'repo_group_id': repo_group_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
'begin_date': begin_date, 'end_date': end_date})

return results

Expand All @@ -200,7 +199,7 @@ def issues_new(repo_group_id, repo_id=None, period='day', begin_date=None, end_d
""")

results = pd.read_sql(issues_new_SQL, engine, params={'repo_id': repo_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
'begin_date': begin_date, 'end_date': end_date})
return results

@register_metric()
Expand Down Expand Up @@ -237,9 +236,8 @@ def issues_active(repo_group_id, repo_id=None, period='day', begin_date=None, en
""")

results = pd.read_sql(issues_active_SQL, engine, params={'repo_group_id': repo_group_id, 'period':period,
'begin_date': begin_date, 'end_date':end_date})
return results

'begin_date': begin_date, 'end_date':end_date})

else:
issues_active_SQL = s.sql.text("""
SELECT
Expand All @@ -257,8 +255,8 @@ def issues_active(repo_group_id, repo_id=None, period='day', begin_date=None, en
""")

results = pd.read_sql(issues_active_SQL, engine, params={'repo_id': repo_id, 'period':period,
'begin_date': begin_date, 'end_date':end_date})
return results
'begin_date': begin_date, 'end_date':end_date})
return results

@register_metric()
def issues_closed(repo_group_id, repo_id=None, period='day', begin_date=None, end_date=None):
Expand Down Expand Up @@ -293,9 +291,7 @@ def issues_closed(repo_group_id, repo_id=None, period='day', begin_date=None, en
""")

results = pd.read_sql(issues_closed_SQL, engine, params={'repo_group_id': repo_group_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})

return results
'begin_date': begin_date, 'end_date': end_date})

else:
issues_closed_SQL = s.sql.text("""
Expand All @@ -314,7 +310,8 @@ def issues_closed(repo_group_id, repo_id=None, period='day', begin_date=None, en

results = pd.read_sql(issues_closed_SQL, engine, params={'repo_id': repo_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
return results

return results

@register_metric()
def issue_duration(repo_group_id, repo_id=None, begin_date=None, end_date=None):
Expand Down Expand Up @@ -351,8 +348,8 @@ def issue_duration(repo_group_id, repo_id=None, begin_date=None, end_date=None):
""")

results = pd.read_sql(issue_duration_SQL, engine, params={'repo_group_id': repo_group_id,
'begin_date': begin_date,
'end_date': end_date})
'begin_date': begin_date,
'end_date': end_date})
results['duration'] = results['duration'].astype(str)
return results

Expand All @@ -375,8 +372,8 @@ def issue_duration(repo_group_id, repo_id=None, begin_date=None, end_date=None):
""")

results = pd.read_sql(issue_duration_SQL, engine, params={'repo_id': repo_id,
'begin_date': begin_date,
'end_date': end_date})
'begin_date': begin_date,
'end_date': end_date})
results['duration'] = results['duration'].astype(str)
return results

Expand Down Expand Up @@ -421,8 +418,8 @@ def issue_participants(repo_group_id, repo_id=None, begin_date=None, end_date=No
""")

result = pd.read_sql(issue_participants_SQL, engine, params={'repo_group_id': repo_group_id,
'begin_date': begin_date,
'end_date': end_date})
'begin_date': begin_date,
'end_date': end_date})
return result
else:
issue_participants_SQL = s.sql.text("""
Expand All @@ -449,8 +446,8 @@ def issue_participants(repo_group_id, repo_id=None, begin_date=None, end_date=No
""")

result = pd.read_sql(issue_participants_SQL, engine, params={'repo_id': repo_id,
'begin_date': begin_date,
'end_date': end_date})
'begin_date': begin_date,
'end_date': end_date})
return result

@register_metric()
Expand Down Expand Up @@ -669,8 +666,9 @@ def average_issue_resolution_time(repo_group_id, repo_id=None):
ORDER BY issues.repo_id
""")


results = pd.read_sql(avg_issue_resolution_SQL, engine,
params={'repo_group_id': repo_group_id})
params={'repo_group_id': repo_group_id})
return results

else:
Expand All @@ -686,7 +684,7 @@ def average_issue_resolution_time(repo_group_id, repo_id=None):
""")

results = pd.read_sql(avg_issue_resolution_SQL, engine,
params={'repo_id': repo_id})
params={'repo_id': repo_id})
return results

@register_metric()
Expand Down Expand Up @@ -896,7 +894,7 @@ def issue_comments_mean(repo_group_id, repo_id=None, group_by='week'):
raise ValueError("Incorrect value for 'group_by'")

results = pd.read_sql(issue_comments_mean_std_SQL, engine,
params={'repo_group_id': repo_group_id})
params={'repo_group_id': repo_group_id})
return results

else:
Expand Down Expand Up @@ -949,7 +947,7 @@ def issue_comments_mean(repo_group_id, repo_id=None, group_by='week'):
raise ValueError("Incorrect value for 'group_by'")

results = pd.read_sql(issue_comments_mean_std_SQL, engine,
params={'repo_id': repo_id})
params={'repo_id': repo_id})
return results

@register_metric()
Expand Down Expand Up @@ -979,9 +977,10 @@ def issue_comments_mean_std(repo_group_id, repo_id=None, group_by='week'):
ORDER BY repo_id, date
""")


results = pd.read_sql(issue_comments_mean_std_SQL, engine,
params={'repo_group_id': repo_group_id,
'group_by': group_by})
params={'repo_group_id': repo_group_id,
'group_by': group_by})
return results

else:
Expand All @@ -1008,7 +1007,7 @@ def issue_comments_mean_std(repo_group_id, repo_id=None, group_by='week'):
""")

results = pd.read_sql(issue_comments_mean_std_SQL, engine,
params={'repo_id': repo_id, 'group_by': group_by})
params={'repo_id': repo_id, 'group_by': group_by})
return results

@register_metric()
Expand Down Expand Up @@ -1059,5 +1058,5 @@ def abandoned_issues(repo_group_id, repo_id=None, period='day', begin_date=None,
)

results = pd.read_sql(abandonedSQL, engine, params={'repo_id': repo_id, 'repo_group_id': repo_group_id, 'period': period,
'begin_date': begin_date, 'end_date': end_date})
'begin_date': begin_date, 'end_date': end_date})
return results

0 comments on commit 9fb55e7

Please sign in to comment.