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: Update naas.secret with new method #438

Merged
merged 11 commits into from Mar 18, 2024

Conversation

l-loic
Copy link
Contributor

@l-loic l-loic commented Feb 6, 2024

this issue resolve #437

@l-loic l-loic requested a review from Dr0p42 February 6, 2024 13:28
@l-loic l-loic linked an issue Feb 6, 2024 that may be closed by this pull request
@Dr0p42 Dr0p42 changed the title first commit feat: Update naas.secret with new method Feb 7, 2024
Copy link
Collaborator

@Dr0p42 Dr0p42 left a comment

Choose a reason for hiding this comment

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

Thank you @l-loic for the pull request. I opened an issue that should be done before proceeding, it will improve the experience, because I am concerned that people might stop the kernel or restart it while the naas.list is actually porting everything if they have a lot of secrets.

naas/secret.py Outdated
except naas_python.domains.secret.SecretSchema.SecretNotFound:
return None
except:
print("Secret get failed")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to have a better error handling here to make sure it reflects the issue we are getting and to help the user fix the issue.

break

# try:
remote_secret = self.__get_remote_secret(name=name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I commented the try/except because it was messing with the SecretNotFound error. But we still need to display something if we have a connection error to api.naas.ai I think

naas/secret.py Outdated Show resolved Hide resolved
@l-loic l-loic self-assigned this Feb 26, 2024
@FlorentLvr
Copy link
Contributor

FlorentLvr commented Mar 18, 2024

@Dr0p42, @l-loic, could you please merge this PR if it's good? It seems that you need to put a correct version number for naas-python to pass the test

image

Copy link
Collaborator

@Dr0p42 Dr0p42 left a comment

Choose a reason for hiding this comment

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

Hello @l-loic, I bumped to the latest version of nasa-python, and the bulk create seems to work ok.

There is a last error though when trying to get a non existing secret:

image

This is what is expected:

image

@Dr0p42
Copy link
Collaborator

Dr0p42 commented Mar 18, 2024

@FlorentLvr @l-loic I did the secrets backup. A soon as @l-loic is fixing the last issue we are ready to merge.

Copy link

sonarcloud bot commented Mar 18, 2024

Quality Gate Passed Quality Gate passed

Issues
9 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Dr0p42 Dr0p42 merged commit 67737d4 into main Mar 18, 2024
2 of 3 checks passed
@Dr0p42 Dr0p42 deleted the 437-update-naassecret-with-new-method branch March 18, 2024 14:05
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.

Update naas.secret with new method
3 participants