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

feat: add login via token for API user for dependabot #963

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

meagharty
Copy link
Contributor

@meagharty meagharty commented Feb 8, 2024

Summary of changes

Asana Ticket: 💳 Fix Dependabot CI on gtfs_creator

  • Adds a new api login module for a token-only read-only user (username/token database entry)
  • Adds a migration to add a token-only read-only user for dependabot

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes.

Copy link

github-actions bot commented Feb 8, 2024

Coverage of commit e6fed59

Summary coverage rate:
  lines......: 88.5% (676 of 764 lines)
  functions..: 59.2% (516 of 871 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web/try_api_token_auth.ex                                |93.3%     15| 100%     3|    -      0
  lib/arrow_web/try_api_token_auth/local.ex                          |50.0%      6| 100%     1|    -      0

Download coverage report

@meagharty meagharty force-pushed the meag/dependabot-github-ci-token branch 2 times, most recently from 6cceaea to 93831e5 Compare February 8, 2024 14:24
Copy link

github-actions bot commented Feb 8, 2024

Coverage of commit 93831e5

Summary coverage rate:
  lines......: 88.9% (680 of 765 lines)
  functions..: 59.2% (516 of 871 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web/try_api_token_auth.ex                                |93.3%     15| 100%     3|    -      0
  lib/arrow_web/try_api_token_auth/local.ex                          | 100%      7| 100%     1|    -      0

Download coverage report

Copy link

github-actions bot commented Feb 8, 2024

Coverage of commit 93831e5

Summary coverage rate:
  lines......: 88.9% (680 of 765 lines)
  functions..: 59.2% (516 of 871 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web/try_api_token_auth.ex                                |93.3%     15| 100%     3|    -      0
  lib/arrow_web/try_api_token_auth/local.ex                          | 100%      7| 100%     1|    -      0

Download coverage report

lib/arrow_web/try_api_token_auth/local.ex Outdated Show resolved Hide resolved
@@ -0,0 +1,30 @@
defmodule ArrowWeb.TryApiTokenAuth.Local do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking suggestions for re-naming this..

@meagharty meagharty requested a review from bklebe February 8, 2024 21:42
@meagharty meagharty changed the title feat: add login for API user for dependabot feat: add login via token for API user for dependabot Feb 8, 2024
@meagharty meagharty marked this pull request as ready for review February 8, 2024 21:51
@meagharty meagharty force-pushed the meag/dependabot-github-ci-token branch from 93831e5 to e6e14bf Compare February 8, 2024 22:49
Copy link

github-actions bot commented Feb 8, 2024

Coverage of commit e6e14bf

Summary coverage rate:
  lines......: 88.9% (680 of 765 lines)
  functions..: 59.2% (516 of 871 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web/try_api_token_auth.ex                                |93.3%     15| 100%     3|    -      0
  lib/arrow_web/try_api_token_auth/local.ex                          | 100%      7| 100%     1|    -      0

Download coverage report

@meagharty meagharty force-pushed the meag/dependabot-github-ci-token branch from e6e14bf to cb358f9 Compare February 9, 2024 20:45
Copy link

github-actions bot commented Feb 9, 2024

Coverage of commit cb358f9

Summary coverage rate:
  lines......: 88.9% (680 of 765 lines)
  functions..: 59.2% (516 of 871 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web/try_api_token_auth.ex                                |93.3%     15| 100%     3|    -      0
  lib/arrow_web/try_api_token_auth/local.ex                          | 100%      7| 100%     1|    -      0

Download coverage report

Copy link
Contributor

@bklebe bklebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meagharty sorry for the late review here. Just to clarify, this is going to generate a new token just for the gtfs_creator CI process? How do we get that token out of Arrow so we can add it to the secrets in the gtfs_creator repo?

@meagharty
Copy link
Contributor Author

meagharty commented Feb 16, 2024

@meagharty sorry for the late review here. Just to clarify, this is going to generate a new token just for the gtfs_creator CI process? How do we get that token out of Arrow so we can add it to the secrets in the gtfs_creator repo?

@bklebe The tokens are committed to the database. Once the code is deployed and the migration runs, I was going to submit an infra request to query the database to fetch the token via the email and add it to the secrets.

@meagharty meagharty requested a review from bklebe February 16, 2024 15:35
Copy link

Coverage of commit 1cabc77

Summary coverage rate:
  lines......: 88.8% (675 of 760 lines)
  functions..: 59.2% (516 of 871 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web/try_api_token_auth.ex                                |93.3%     15| 100%     3|    -      0
  lib/arrow_web/try_api_token_auth/local.ex                          | 100%      2| 100%     1|    -      0

Download coverage report

@meagharty meagharty merged commit b0bd345 into master Feb 26, 2024
16 checks passed
@meagharty meagharty deleted the meag/dependabot-github-ci-token branch February 26, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants