-
Notifications
You must be signed in to change notification settings - Fork 238
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
Chore: Extension generation improvements #2300
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for specter-desktop-docs canceled.
|
@k9ert , could you please take a look? |
.cirrus.yml
Outdated
@@ -109,7 +109,7 @@ extension_smoketest_task: | |||
- mkdir tmp && cd tmp | |||
- mkdir testextension && cd testextension | |||
- pwd | |||
- python3 -m cryptoadvance.specter ext gen --ext-id cicdtest --org cryptoadvance --no-isolated-client --devicename cicddevice | |||
- python3 -m cryptoadvance.specter ext gen --ext-id cicdtest --org cryptoadvance --no-isolated-client --no-encrypted-userdata --devicename cicddevice --version v2.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the version should be omitted here.
- python3 -m cryptoadvance.specter ext gen --ext-id cicdtest --org cryptoadvance --no-isolated-client --no-encrypted-userdata --devicename cicddevice --version v2.0.0 | |
- python3 -m cryptoadvance.specter ext gen --ext-id cicdtest --org cryptoadvance --no-isolated-client --no-encrypted-userdata --devicename cicddevice |
We want to know whether the current branch this is currently being tested, works on the master of specterext-dummy
. That might be not optimal in some cases but the best we can get for most of the cases where we have chages in a PR which (hopefully) still match the state in master of specterext-dummy
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the smoke test fails if I remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I read the issue again and I think, we need a version since templates are becoming more dependent on the version of Specter controlling the generation process and if no version is specified, it should fall back to master.
If the user chooses to add a specific version, it will render extension accordingly, else the tag(branch) will be master and version will be the latest one.
@@ -59,6 +59,37 @@ def loop(self, dt=3600): | |||
) | |||
time.sleep(dt) | |||
|
|||
def _check_if_version_is_available(self, custom_version): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is checking on pypi. But the relevant check is the tag/branch in the specter-ext repo:
https://github.com/cryptoadvance/specterext-dummy/tags
This is what needs to be used when someone is referring to a tag. So can you change that to check whether the tag/branch is existing? You can also put that check as a class-method in the GithubUrlLoader
, It doesn't need to be in the util package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay will do that
@@ -46,13 +48,20 @@ def __init__( | |||
self.base_path = base_path | |||
self.org = ext_org | |||
self.id = ext_id | |||
self.encrypted_userdata = encrypted_userdata | |||
self.tag = tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You introduce here self.tag
which is a better name than self.branch
. Can you remove the self.branch
then and adjust the usage? E.g. the GithubUrlLoader
currently has a parameter called "branch" but it should be called tag
(and initialized with your self.tag
.
In #1957 i also talk about necessary changes in the template-directory:
That would need to be done as well. Please create PR there. |
Fixes for #1957