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

Manage project-credentials via provisioning API #2372

Merged
merged 19 commits into from
Aug 16, 2024

Conversation

midigofrank
Copy link
Collaborator

@midigofrank midigofrank commented Aug 12, 2024

Description

Validation steps

  1. (How can a reviewer validate your work?)

Additional notes for the reviewer

  1. (Is there anything else the reviewer should know or look out for?)

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.

@midigofrank midigofrank self-assigned this Aug 12, 2024
@midigofrank midigofrank changed the title load credentials in job Support credentials in project.yaml Aug 12, 2024
@taylordowns2000 taylordowns2000 force-pushed the support-credentials-in-cli-deploy branch from 2e04743 to 00ed0b2 Compare August 12, 2024 20:03
@midigofrank midigofrank changed the base branch from main to credential-name-uniqueness August 13, 2024 04:54
Base automatically changed from credential-name-uniqueness to main August 13, 2024 15:18
@taylordowns2000 taylordowns2000 marked this pull request as ready for review August 13, 2024 15:22
@taylordowns2000
Copy link
Member

when merging this, please merge OpenFn/docs#533

@taylordowns2000 taylordowns2000 changed the title Support credentials in project.yaml Manage project-credentials via provisioning API Aug 13, 2024
@taylordowns2000
Copy link
Member

taylordowns2000 commented Aug 13, 2024

@christad92 and @stuartc , this is ready to go. note that the integration tests will not pass until OpenFn/kit#743 is merged and released.

(This poses a tricky co-dependency, cc @josephjclark .)

Note that the full feature here is represented by:

  1. This PR here Manage project-credentials via provisioning API #2372
  2. This PR in kit Support credentials in deploy package kit#743
  3. And this PR in docs Showcase support for file paths in project-spec.yaml docs#533

I'll send the branches and testing instructions to MSF now and we may have feedback on how they want this to work, but the big picture is satisfied and we can now set up a full, running Lightning instance via shell script!

git clone msf-openfn-lime-iraq
docker compose blah blah
docker exec -it <BLAH> -- /app/bin/lightning eval Lightning.SetupUtils.setup_user(%{first_name: "Michel", last_name: "B", email: "blah@geneva.msf.org", password: "passwordFromVault"}, "apiTokenFromVault", [%{name: "openmrs", schema: "raw", body: %{"a" => "secret"}}, %{ name: "dhis2", schema: "raw", body: %{“username” => “admin”, "password" => "passwordFromVault"}}])
openfn deploy projectIraq.yaml

It's pretty rad 😄

Copy link

@christad92 christad92 left a comment

Choose a reason for hiding this comment

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

Great work! Love it

Copy link
Member

@stuartc stuartc left a comment

Choose a reason for hiding this comment

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

@taylordowns2000 on you to test deletion 👍

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.85%. Comparing base (4ee43fa) to head (9b0f095).
Report is 5 commits behind head on main.

Files Patch % Lines
lib/lightning/projects/provisioner.ex 90.90% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2372      +/-   ##
==========================================
+ Coverage   89.83%   89.85%   +0.02%     
==========================================
  Files         305      305              
  Lines       10455    10497      +42     
==========================================
+ Hits         9392     9432      +40     
- Misses       1063     1065       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@taylordowns2000 taylordowns2000 merged commit 8397e33 into main Aug 16, 2024
0 of 6 checks passed
@taylordowns2000 taylordowns2000 deleted the support-credentials-in-cli-deploy branch August 16, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Allow deploy to manage credential associations for jobs in lightning
4 participants