diff --git a/s7_deployment/frontend.md b/s7_deployment/frontend.md index fe3dd254c..3800912eb 100644 --- a/s7_deployment/frontend.md +++ b/s7_deployment/frontend.md @@ -161,7 +161,7 @@ which can be found in the `samples/frontend_backend` folder. 3. Have a button that sends the image to the backend and displays the result - For now just assume that a environment variable called `BACKEND` is available that contains the URL of the + For now just assume that an environment variable called `BACKEND` is available that contains the URL of the backend. We will in the next step show how to get this URL automatically. ??? success "Solution" @@ -229,10 +229,10 @@ which can be found in the `samples/frontend_backend` folder. 8. Run the frontend image ```bash - docker run --rm -p 8001:8001 -e "PORT=8001" backend + docker run --rm -p 8001:8001 -e "PORT=8001" frontend ``` - and check in your web browser that the frontend works as expected. + And check in your web browser that the frontend works as expected. 9. Deploy the frontend to Cloud run using the `gcloud` command diff --git a/samples/frontend_backend/frontend.dockerfile b/samples/frontend_backend/frontend.dockerfile index 46aef35eb..b249c80c0 100644 --- a/samples/frontend_backend/frontend.dockerfile +++ b/samples/frontend_backend/frontend.dockerfile @@ -15,4 +15,4 @@ RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements_front EXPOSE $PORT -CMD ["streamlit", "run", "frontend.py", "--server.port", "$PORT"] +ENTRYPOINT ["streamlit", "run", "frontend.py", "--server.port", "$PORT", "--server.address=0.0.0.0"] diff --git a/tools/repo_stats/scraper.py b/tools/repo_stats/scraper.py index d6c5a4593..3c9e61a20 100644 --- a/tools/repo_stats/scraper.py +++ b/tools/repo_stats/scraper.py @@ -118,18 +118,25 @@ def main(): merged_prs = [p["number"] for p in prs if p["merged_at"] is not None] for pr_num in merged_prs: - pr_commits = requests.get( + pr_commits: list[dict] = requests.get( f"{group.repo_api}/pulls/{pr_num}/commits", headers=headers, timeout=100 ).json() commit_messages += [c["commit"]["message"] for c in pr_commits] for commit in pr_commits: for contributor in contributors: + commit_author = commit.get("author") # GitHub account info + commit_committer = commit.get("committer") # GitHub account info + commit_author_name = commit["commit"]["author"]["name"] + commit_committer_name = commit["commit"]["committer"]["name"] + if ( - commit["committer"] is not None - and "login" in commit["committer"] - and contributor.login == commit["author"]["login"] + (commit_author and commit_author["login"] == contributor.login) + or (commit_author_name == contributor.login) + or (commit_committer and commit_committer["login"] == contributor.login) + or (commit_committer_name == contributor.login) ): contributor.commits_pr += 1 + break commits += pr_commits activity_matrix = create_activity_matrix(commits, max_delta=3, min_delta=1)