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

fix formatting #50

Merged
merged 7 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DirectReport/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

from DirectReport.commandline import commandline


def main():
commandline.cli()


if __name__ == "__main__":
main()
13 changes: 11 additions & 2 deletions DirectReport/browserview/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
login_manager.login_view = "login"
user_model = UserModel()


@app.route("/")
def home():
"""
Expand All @@ -34,6 +35,7 @@
"""
return render_template('index.html', title='Home')


@app.errorhandler(404)
def page_not_found(e):
"""
Expand All @@ -44,17 +46,20 @@
"""
return render_template('404.html', error=e), 404


@login_manager.user_loader
def user_loader(email):
user = user_model.get_user_by_email(email)
return user

Check warning on line 53 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L52-L53

Added lines #L52 - L53 were not covered by tests


@login_manager.request_loader
def request_loader(request):
email = request.form.get('email')
user = user_model.get_user_by_email(email)
return user


@app.route("/new", methods=['GET', 'POST'])
@login_required
def new():
Expand All @@ -64,36 +69,40 @@
"""
return render_template('list.html', title='New Entry', data=[])


@login_manager.unauthorized_handler
def unauthorized_handler():
if request.headers.get("X-Requested-With") == "XMLHttpRequest":
return redirect(url_for('auth.login'))

Check warning on line 76 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L76

Added line #L76 was not covered by tests
else:
if current_user.is_authenticated:
return redirect(url_for('auth.account'))

Check warning on line 79 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L79

Added line #L79 was not covered by tests
else:
return redirect(url_for('auth.login'))


@app.route("/team", methods=['GET'])
def team():
return render_template('team/team.html', title='Team', data=[])

Check warning on line 86 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L86

Added line #L86 was not covered by tests


@app.route("/generate_email", methods=['POST'])
def generate_email():
def generateemail():
prompt = ""

Check warning on line 91 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L91

Added line #L91 was not covered by tests
if request.method == "POST":
prompt = json.dumps(request.get_json()["prompt"])
report = generate_email(prompt)
elements = {"email": report.choices[0].message.content}
return elements, 201

Check warning on line 96 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L93-L96

Added lines #L93 - L96 were not covered by tests


@app.route("/repo/<reponame>", methods=['GET'])
def repo(reponame=None):

client = GithubClient()
repo = client.get_repo_issues("chriswebb09", reponame)
print(repo)
return render_template('team/team.html', title='Team', data=[])

Check warning on line 104 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L101-L104

Added lines #L101 - L104 were not covered by tests


if __name__ == "__main__":
app.run(debug=True, port=5000)

Check warning on line 108 in DirectReport/browserview/app.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/app.py#L108

Added line #L108 was not covered by tests
21 changes: 10 additions & 11 deletions DirectReport/browserview/auth/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,71 @@

user_model = UserModel()


@auth.route('/signup', methods=['POST', 'GET'])
def signup():
if request.method == 'POST':
# code to validate and add user to database goes here
email = request.form.get('email')
username = request.form.get('username')
firstname = request.form.get('firstname')
lastname = request.form.get('lastname')
password_text = request.form.get('password')
password = generate_password_hash(password_text)
user_model.insert_user(email, username, firstname, lastname, email, password)
return redirect(url_for('auth.login'))
return render_template('auth/signup.html')

Check warning on line 29 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L21-L29

Added lines #L21 - L29 were not covered by tests


@auth.route('/logout')
@login_required
def logout():
logout_user()
return redirect(url_for('reportsbp.team_report'))

Check warning on line 36 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L35-L36

Added lines #L35 - L36 were not covered by tests


@auth.route('/login', methods=['POST', 'GET'])
def login():
if request.method == 'POST':
email = request.form.get('email')
password = request.form.get('password')
remember = True if request.form.get('remember') else False
user = app.user_loader(email)

Check warning on line 45 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L42-L45

Added lines #L42 - L45 were not covered by tests
if user.check_password(password):
login_user(user, remember=remember, force=True)

Check warning on line 47 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L47

Added line #L47 was not covered by tests
if current_user.is_authenticated():
return redirect(url_for('auth.account'))

Check warning on line 49 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L49

Added line #L49 was not covered by tests
else:
print("password no match")
flash("Please check your login details and try again.")
return render_template('auth/login.html')

Check warning on line 53 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L51-L53

Added lines #L51 - L53 were not covered by tests


@auth.route("/account", methods=['GET', 'POST'])
@login_required
def account():
return render_template('account.html', title='Account', name=current_user.username, userid=current_user.id)

Check warning on line 59 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L59

Added line #L59 was not covered by tests


@auth.route("/account_data", methods=['GET'])
@login_required
def account_data():
saved_reports = ReportBuilder.get_reports_for_user_id(current_user.id)
logitem = "Adrian Prantl (67):\n add mangling testcase\n Debug Info: Represent private discriminators in DWARF.\n Revert Debug Info: Represent private discriminators in DWARF.\"\n Debug Info: Represent private discriminators in DWARF.\n Un-XFAIL and update test.\n Move the logic for ignoring the debug locations for closure setup code into SILGen. NFC-ish.\n Debug Info: Associate a function call with the beginning of the expression.\n Debug Info / SILGen: fix the source location of variable assignments\n typo\n Fix the debug locations of inserted operations in AvailableValueAggregator.\n Don't emit shadow copies for anonymous variables.\n Remove dead API IRGenDebugInfo::setArtificialTrapLocation().\n Use compiler-generated location for func.-sig.-spec. thunks\n whitespace\n Fix the missing inlined-at field of function-level SILDebugScopes.\n Add debug info support for inlined and specialized generic variables.\n Revert Add debug info support for inlined and specialized generic variables.\"\n Add debug info support for inlined and specialized generic variables.\n Update mangling prefix in Mangling.rst\n Add initial support for debug info for coroutine allocas.\n Temporarily disable failing test case, rdar://problem/43340064\n Add build-script support for the Swift LLDB backwards-compatibility tests.\n Remove accidentally committed debugging code\n Deserialize Swift compatibility version in CompilerInvocation::loadFromSerializedAST()\n SILGen: Preserve function argument debug info for arguments needing alloc_stack\n Use as the filename for SILLocation-less functions to avoid misleading source locatio\nns in backtraces.\n Add a -verify-linetable LLVM option.\n Enable debug info for inlined generics by default. It works now.\n Fix nonasserts compilation\n\nAhmad Alhashemi (5):\n [Parser] Detect nonbreaking space U+00A0 and fixit\n Move non-breaking space handling to lexUnknown\n Add more non-breaking space test cases\n Minor style edits\n Add tests for non-breaking space detect and fix-it\n\nAkshay Shrimali (1):\n Update README.md\n\nAlan Zeino (1):\n Fix typo in code example in libSyntax README\n\nAlbin Sadowski (1):\n Fix syntax highlighting in CHANGELOG (#15107)\n\nAlejandro (3):\n Remove a warning, some doc fixes (#16863)\n [SR-8178] Fix BinaryFloatingPoint.random(in:) open range returning upperBound (#17794)\n [Docs] Fix minor code typo in SILPro..Man..md\n\nAlex Blewitt (5):\n [SR-7032] Fix compare for lhs and rhs\n [SR-7036] Use || instead of && for kind comparison\n [SR-7041] Remove duplicate conditional check\n Remove duplicate verb\n [SR-7043] Remove duplicate if statement"
client = GithubClient()
shortlog = client.parse_git_shortlog(logitem)
report_results = []

Check warning on line 69 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L65-L69

Added lines #L65 - L69 were not covered by tests
for report in saved_reports:
report_element = {
"report": report
}
report_element = {"report": report}
report_results.append(report_element)

Check warning on line 72 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L71-L72

Added lines #L71 - L72 were not covered by tests

user_account = {
user_account = {

Check warning on line 74 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L74

Added line #L74 was not covered by tests
"name": current_user.firstname + " " + current_user.lastname,
"firstname": current_user.firstname,
"lastname": current_user.lastname,
"userid": current_user.id,
"username": current_user.username,
"email": current_user.email
}
user_element = {
"user": user_account,
"reports": report_results,
"shortlog": shortlog
"email": current_user.email,
}
return user_element, 201
user_element = {"user": user_account, "reports": report_results, "shortlog": shortlog}
return user_element, 201

Check warning on line 83 in DirectReport/browserview/auth/auth.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/auth/auth.py#L82-L83

Added lines #L82 - L83 were not covered by tests
8 changes: 3 additions & 5 deletions DirectReport/browserview/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
Returns:
A dictionary with the author and their commits.
"""
authors = {}

Check warning on line 23 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L23

Added line #L23 was not covered by tests
for line in shortlog.splitlines():
match = re.match(r"^(.*?)\s+\((.*?)\):", line)

Check warning on line 25 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L25

Added line #L25 was not covered by tests
if match:
author, commits = match.groups()
authors[author] = int(commits)
return authors

Check warning on line 29 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L27-L29

Added lines #L27 - L29 were not covered by tests

# def get_pull_request_comments_count(repo_owner, repo_name, pull_request_number):
def get_pull_request_comments(self, repo_owner, repo_name):
Expand All @@ -41,12 +41,12 @@
comments on pull requests.
"""

url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/pulls/comments"
headers = {"Authorization": f"token {appsecrets.GITHUB_TOKEN}"}

Check warning on line 45 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L44-L45

Added lines #L44 - L45 were not covered by tests

response = requests.get(url, headers=headers)
response.raise_for_status()
return response.json()

Check warning on line 49 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L47-L49

Added lines #L47 - L49 were not covered by tests

def get_pull_requests_count(self, repo_owner, repo_name):
"""
Expand All @@ -61,48 +61,46 @@
The number of comments on the pull request.
"""

url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/pulls"
headers = {"Authorization": f"token {appsecrets.GITHUB_TOKEN}"}
response = requests.get(url, headers=headers)
response.raise_for_status()
return len(response.json())

Check warning on line 68 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L64-L68

Added lines #L64 - L68 were not covered by tests

def get_user_repos(self, repo_owner):
url = f"https://api.github.com/users/{repo_owner}/repos?sort=updated&order=desc"
headers = {"Authorization": f"token {appsecrets.GITHUB_TOKEN}"}
response = requests.get(url, headers=headers)
response.raise_for_status()
return response.json()

Check warning on line 75 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L71-L75

Added lines #L71 - L75 were not covered by tests

def get_repo_issues(self, repo_owner, repo_name):
headers = {"Authorization": f"token {appsecrets.GITHUB_TOKEN}"}
url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/issues"
response = requests.get(url, headers=headers)
response.raise_for_status()
return response.json()

Check warning on line 82 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L78-L82

Added lines #L78 - L82 were not covered by tests

class HuggingFaceClient:

class HuggingFaceClient:
def query(self, payload):
API_URL = "https://api-inference.huggingface.co/models/meta-llama/Llama-2-7b-chat-hf"
headers = {"Authorization": "Bearer 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"}
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()

Check warning on line 90 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L87-L90

Added lines #L87 - L90 were not covered by tests

class GoogleAIClient:


class GoogleAIClient:
def query(self, prompt):
API_URL = f"https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText?key={appsecrets.GOOGLE_AI_TOKEN}"
headers = {"Content-Type": "application/json"}
prompt_data = prompts.GENERATE_SUMMARY_PROMPT_PREIX + prompt
data = {"prompt": { "text": f"{prompt_data}"}}
data = {"prompt": {"text": f"{prompt_data}"}}
response = requests.post(API_URL, data=json.dumps(data), headers=headers)
data = json.loads(response.text)
return data

Check warning on line 101 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L95-L101

Added lines #L95 - L101 were not covered by tests

def get_data_from(self, prompt):
response = self.query(prompt)
response_data = response["candidates"][0]["output"]
return response_data

Check warning on line 106 in DirectReport/browserview/github.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/github.py#L104-L106

Added lines #L104 - L106 were not covered by tests

121 changes: 81 additions & 40 deletions DirectReport/browserview/modelclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,37 @@
global RAW_REPORT_DATA
global RAW_REPORT_DATA_2

RAW_REPORT_DATA = "Adrian Prantl (67):\n add mangling testcase\n Debug Info: Represent private discriminators in DWARF.\n Revert Debug Info: Represent private discriminators in DWARF. \n Debug Info: Represent private discriminators in DWARF.\n Un-XFAIL and update test.\n Move the logic for ignoring the debug locations for closure setup code into SILGen. NFC-ish.\n Debug Info: Associate a function call with the beginning of the expression.\n Debug Info / SILGen: fix the source location of variable assignments\n typo\n Fix the debug locations of inserted operations in AvailableValueAggregator.\n Don't emit shadow copies for anonymous variables.\n Remove dead API IRGenDebugInfo::setArtificialTrapLocation().\n Use compiler-generated location for func.-sig.-spec. thunks\n whitespace\n Fix the missing inlined-at field of function-level SILDebugScopes.\n Add debug info support for inlined and specialized generic variables.\n Revert \"Add debug info support for inlined and specialized generic variables.\"\n Add debug info support for inlined and specialized generic variables.\n Update mangling prefix in Mangling.rst\n Add initial support for debug info for coroutine allocas.\n Temporarily disable failing test case, rdar://problem/43340064\n Add build-script support for the Swift LLDB backwards-compatibility tests.\n Remove accidentally committed debugging code\n Deserialize Swift compatibility version in CompilerInvocation::loadFromSerializedAST()\n SILGen: Preserve function argument debug info for arguments needing alloc_stack\n Use as the filename for SILLocation-less functions to avoid misleading source locatio\nns in backtraces.\n Add a -verify-linetable LLVM option.\n Enable debug info for inlined generics by default. It works now.\n Fix nonasserts compilation\n\nAhmad Alhashemi (5):\n [Parser] Detect nonbreaking space U+00A0 and fixit\n Move non-breaking space handling to lexUnknown\n Add more non-breaking space test cases\n Minor style edits\n Add tests for non-breaking space detect and fix-it\n\nAkshay Shrimali (1):\n Update README.md\n\nAlan Zeino (1):\n Fix typo in code example in libSyntax README\n\nAlbin Sadowski (1):\n Fix syntax highlighting in CHANGELOG (#15107)\n\nAlejandro (3):\n Remove a warning, some doc fixes (#16863)\n [SR-8178] Fix BinaryFloatingPoint.random(in:) open range returning upperBound (#17794)\n [Docs] Fix minor code typo in SILPro..Man..md\n\nAlex Blewitt (5):\n [SR-7032] Fix compare for lhs and rhs\n [SR-7036] Use || instead of && for kind comparison\n [SR-7041] Remove duplicate conditional check\n Remove duplicate verb\n [SR-7043] Remove duplicate if statement"

Check warning on line 7 in DirectReport/browserview/modelclient.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/modelclient.py#L7

Added line #L7 was not covered by tests

TEST_DATA_ELEMENTS = elements = {

Check warning on line 9 in DirectReport/browserview/modelclient.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/modelclient.py#L9

Added line #L9 was not covered by tests
"team": [
{
"name": "Adrian Prantl",
"accomplishments": "Adrian made significant contributions to the DebugInfo and SILGen, including adding support for debug info for coroutine alloc as,inlined and specialized generic variables.He also worked on the mangling testcase,fixed source locations of variable assignments and function calls, and added build-script support for SwiftLLDB backwards-compatibility tests.",
"commits": "67"
"commits": "67",
},
{
"name": "Alan Zeino",
"accomplishments": "Alan fixed a typo in the code example in libSyntax README.",
"commits": "1"
"commits": "1",
},
{
"name": "Alejandro",
"accomplishments": "Alejandro removed awarning, made some documentation fixes, fixed Binary Floating Point. random(in:) open range returning upperBound, and fixed a minor code typo in SILPro.",
"commits": "3"
},
{
"name": "Akshay Shrimali",
"accomplishments": "Akshay updated the README.md file.",
"commits": "1"
"commits": "3",
},
{"name": "Akshay Shrimali", "accomplishments": "Akshay updated the README.md file.", "commits": "1"},
{
"name": "Ahmad Alhashemi",
"accomplishments": "Ahmad worked on the Parser, detecting non breaking space U+00A0 and providing a fix.He also made minor style edits and added more non-breaking space testcases.",
"commits": "5"
},
{
"name": "Albin Sadowski",
"accomplishments": "Albin fixed syntax highlighting in CHANGELOG.",
"commits": "1"
"commits": "5",
},
{"name": "Albin Sadowski", "accomplishments": "Albin fixed syntax highlighting in CHANGELOG.", "commits": "1"},
{
"name": "Alex Blewitt",
"accomplishments": "Alex worked on several fixes including compare for lhs and rhs, using || instead of && for kind comparison,removing duplicate conditional check and duplicate if statement.",
"commits": "5"
}
"commits": "5",
},
],
"report": {
"summary": "The team made significant progress this week with a total of 83 commits.The main focus was on DebugInfo and SILGen enhancements, Parser improvements, and various fixes.",
Expand All @@ -51,18 +43,18 @@
"highlights": [
{
"title": "DebugInfo and SILGen Enhancements",
"description": "Adrian Prantl made significant contributions to the DebugInfo and SILGen, including adding support for debuginfo for coroutine allocas, inlined and specialized generic variables."
"description": "Adrian Prantl made significant contributions to the DebugInfo and SILGen, including adding support for debuginfo for coroutine allocas, inlined and specialized generic variables.",
},
{
"title": "Parser Improvements",
"description": "Ahmad Alhashemi worked on the Parser,detecting non breaking space U+00A0 and providing a fix."
"description": "Ahmad Alhashemi worked on the Parser,detecting non breaking space U+00A0 and providing a fix.",
},
{
"title": "Various Fixes",
"description": "The team worked on several fixes including compare for lhs and rhs, using || instead of && for kind comparison,removing duplicate conditional check and duplicate if statement."
}
"description": "The team worked on several fixes including compare for lhs and rhs, using || instead of && for kind comparison,removing duplicate conditional check and duplicate if statement.",
},
],
"conclusion": "The team demonstrated good progress this week, with a focus on enhancing DebugInfo and SILGen, improving the Parser, and implementing various fixes. The team should continue to focus on these areas in the coming week."
"conclusion": "The team demonstrated good progress this week, with a focus on enhancing DebugInfo and SILGen, improving the Parser, and implementing various fixes. The team should continue to focus on these areas in the coming week.",
},
"broad_categories": {
"debug_info": 16,
Expand All @@ -71,34 +63,83 @@
"test_related": 6,
"nonbreaking_space_handling": 5,
"readme_update": 1,
"syntax_fix": 1
}

"syntax_fix": 1,
},
}

RAW_REPORT_DATA_2 = {"report": {
"broad_categories": {"code_maintenance": 9, "debug_info": 16, "documentation": 7, "nonbreaking_space_handling": 5, "readme_update": 1, "syntax_fix": 1, "test_related": 6},

RAW_REPORT_DATA_2 = {

Check warning on line 70 in DirectReport/browserview/modelclient.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/modelclient.py#L70

Added line #L70 was not covered by tests
"report": {
"broad_categories": {
"code_maintenance": 9,
"debug_info": 16,
"documentation": 7,
"nonbreaking_space_handling": 5,
"readme_update": 1,
"syntax_fix": 1,
"test_related": 6,
},
"report": {
"areas_of_focus": ['DebugInfo and SILGen Enhancements', 'Parser Improvements', 'Various Fixes'],
"conclusion": 'The team demonstrated good progress this week, with a focus on enhancing DebugInfo and SILGen, improving the Parser, and implementing various fixes. The team should continue to focus on these areas in the coming week.',
"highlights": [
{"description": 'Adrian Prantl made significant contributions to the DebugInfo and SILGen, including adding support for debuginfo for coroutine allocas, inlined and specialized generic variables.', 'title': 'DebugInfo and SILGen Enhancements'},
{"description": 'Ahmad Alhashemi worked on the Parser, detecting non-breaking space U+00A0 and providing a fix.', 'title': 'Parser Improvements'},
{"description": 'The team worked on several fixes including compare for lhs and rhs, using || instead of && for kind comparison, removing duplicate conditional check and duplicate if statement.', 'title': 'Various Fixes'}
{
"description": 'Adrian Prantl made significant contributions to the DebugInfo and SILGen, including adding support for debuginfo for coroutine allocas, inlined and specialized generic variables.',
'title': 'DebugInfo and SILGen Enhancements',
},
{
"description": 'Ahmad Alhashemi worked on the Parser, detecting non-breaking space U+00A0 and providing a fix.',
'title': 'Parser Improvements',
},
{
"description": 'The team worked on several fixes including compare for lhs and rhs, using || instead of && for kind comparison, removing duplicate conditional check and duplicate if statement.',
'title': 'Various Fixes',
},
],
'summary': 'The team made significant progress this week with a total of 83 commits. The main focus was on DebugInfo and SILGen enhancements, Parser improvements, and various fixes.',
'total_commits': '83'
'total_commits': '83',
},
"shortlog": {
'Adrian Prantl': 67,
'Ahmad Alhashemi': 5,
'Akshay Shrimali': 1,
'Alan Zeino': 1,
'Albin Sadowski': 1,
'Alejandro': 3,
'Alex Blewitt': 5,
},
"shortlog": {'Adrian Prantl': 67, 'Ahmad Alhashemi': 5, 'Akshay Shrimali': 1, 'Alan Zeino': 1, 'Albin Sadowski': 1, 'Alejandro': 3, 'Alex Blewitt': 5},
"team": [
{'accomplishments': 'Adrian made significant contributions to the DebugInfo and SILGen, including adding support for debug info for coroutine allocas, inlined and specialized generic variables. He also worked on the mangling testcase, fixed source locations of variable assignments and function calls, and added build-script support for Swift LLDB backwards-compatibility tests.', 'commits': '67', 'name': 'Adrian Prantl'},
{'accomplishments': 'Alan fixed a typo in the code example in libSyntax README.', 'commits': '1', 'name': 'Alan Zeino'},
{'accomplishments': 'Alejandro removed a warning, made some documentation fixes, fixed Binary Floating Point. random(in:) open range returning upperBound, and fixed a minor code typo in SILPro.', 'commits': '3', 'name': 'Alejandro'},
{
'accomplishments': 'Adrian made significant contributions to the DebugInfo and SILGen, including adding support for debug info for coroutine allocas, inlined and specialized generic variables. He also worked on the mangling testcase, fixed source locations of variable assignments and function calls, and added build-script support for Swift LLDB backwards-compatibility tests.',
'commits': '67',
'name': 'Adrian Prantl',
},
{
'accomplishments': 'Alan fixed a typo in the code example in libSyntax README.',
'commits': '1',
'name': 'Alan Zeino',
},
{
'accomplishments': 'Alejandro removed a warning, made some documentation fixes, fixed Binary Floating Point. random(in:) open range returning upperBound, and fixed a minor code typo in SILPro.',
'commits': '3',
'name': 'Alejandro',
},
{'accomplishments': 'Akshay updated the README.md file.', 'commits': '1', 'name': 'Akshay Shrimali'},
{'accomplishments': 'Ahmad worked on the Parser, detecting non-breaking space U+00A0 and providing a fix. He also made minor style edits and added more non-breaking space testcases.', 'commits': '5', 'name': 'Ahmad Alhashemi'},
{'accomplishments': 'Albin fixed syntax highlighting in CHANGELOG.', 'commits': '1', 'name': 'Albin Sadowski'},
{'accomplishments': 'Alex worked on several fixes including compare for lhs and rhs, using || instead of && for kind comparison, removing duplicate conditional check and duplicate if statement.', 'commits': '5', 'name': 'Alex Blewitt'}
]
{
'accomplishments': 'Ahmad worked on the Parser, detecting non-breaking space U+00A0 and providing a fix. He also made minor style edits and added more non-breaking space testcases.',
'commits': '5',
'name': 'Ahmad Alhashemi',
},
{
'accomplishments': 'Albin fixed syntax highlighting in CHANGELOG.',
'commits': '1',
'name': 'Albin Sadowski',
},
{
'accomplishments': 'Alex worked on several fixes including compare for lhs and rhs, using || instead of && for kind comparison, removing duplicate conditional check and duplicate if statement.',
'commits': '5',
'name': 'Alex Blewitt',
},
],
},
'created_at': '1702314769.558132'}
'created_at': '1702314769.558132',
}
19 changes: 7 additions & 12 deletions DirectReport/browserview/prompt_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,21 @@
from DirectReport.datadependencies import appsecrets, prompts

openai.api_key = appsecrets.SECRET_KEY


def generate_email(data):
prompt = prompts.GENERATE_EMAIL_PROMPT_PREFIX + data
message=[{"role": "user", "content": prompt}]
message = [{"role": "user", "content": prompt}]
response = openai.ChatCompletion.create(

Check warning on line 14 in DirectReport/browserview/prompt_logic.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/prompt_logic.py#L12-L14

Added lines #L12 - L14 were not covered by tests
model="gpt-4",
messages = message,
temperature=0.1,
max_tokens=1000,
frequency_penalty=0.0
model="gpt-4", messages=message, temperature=0.1, max_tokens=1000, frequency_penalty=0.0
)
return response

Check warning on line 17 in DirectReport/browserview/prompt_logic.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/prompt_logic.py#L17

Added line #L17 was not covered by tests


def get_team_summarys_from_git_shortlog(data):
prompt = prompts.GENERATE_SUMMARY_PROMPT_PREIX + data
message=[{"role": "user", "content": prompt}]
message = [{"role": "user", "content": prompt}]
response = openai.ChatCompletion.create(

Check warning on line 23 in DirectReport/browserview/prompt_logic.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/prompt_logic.py#L21-L23

Added lines #L21 - L23 were not covered by tests
model="gpt-4",
messages = message,
temperature=0,
max_tokens=1000,
frequency_penalty=0.0
model="gpt-4", messages=message, temperature=0, max_tokens=1000, frequency_penalty=0.0
)
return response

Check warning on line 26 in DirectReport/browserview/prompt_logic.py

View check run for this annotation

Codecov / codecov/patch

DirectReport/browserview/prompt_logic.py#L26

Added line #L26 was not covered by tests
Loading
Loading