-
Notifications
You must be signed in to change notification settings - Fork 11
Add Scope for Resource_Gitea_Token #53
base: main
Are you sure you want to change the base?
Conversation
…te Vendor Directory, Change Version to 0.16.1
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.
Hi @David-Elizondo ,
thanks a lot for the PR. This is definitely a good addition 😃
a few points independent from the inline comments:
- please run
make doc
to generate new documentation for the provider - implement a gitea version check on this new addition like i did here: https://github.com/Lerentis/terraform-provider-gitea/blob/main/gitea/resource_gitea_team.go#L231 in order to only take this into consideration when the gitea server supports this as well
Makefile
Outdated
@@ -5,7 +5,7 @@ KERNEL?=$$(uname -s | tr '[:upper:]' '[:lower:]') | |||
|
|||
GOFMT ?= gofmt -s | |||
|
|||
VERSION = 0.16.0 | |||
VERSION = 0.16.1 |
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 this is definitely worthy of a minor release and not a patch release ;-)
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.
bumped :)
gitea/resource_gitea_token.go
Outdated
}, | ||
Optional: true, | ||
ForceNew: true, | ||
Description: "The token scope", |
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.
maybe add the list of possible values here as it would directly be computed into the documentation
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.
Added the list from go-gitea/gitea#24767
@@ -3,7 +3,7 @@ module git.uploadfilter24.eu/terraform-provider-gitea | |||
go 1.18 | |||
|
|||
require ( | |||
code.gitea.io/sdk/gitea v0.15.1 | |||
code.gitea.io/sdk/gitea v0.15.1-0.20230815151548-091528835fc2 |
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 am wondering if this is not just the way to go. the gitea SDK maintainers do not really release anymore it seems. will try to reach out and clarify the situation but with what i know now this would not be a blocker to move forward here
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.
Yeah, It seems to be odd. Not sure if this is related to them changing license structure?
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.
just to give you an update:
i wrote a mail to @6543 to ask about a possible release as he is the one who did the last release of the go sdk, but did not yet receive any response.
i will wait until next week and if there is no response by then i will just assume that this is the way to go 🤷
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.
Ok 👍 Thanks for the update :)
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.
@David-Elizondo As an FYI, there is no licensing change to any Gitea repos.
I've released 0.16.0 to the go-sdk, so hopefully, you don't need to target a hash in the gomod anymore.
The official terraform provider is back under active development, with all of @Lerentis amazing changes merged back in, and @Lerentis has been invited to be a maintainer of the provider (and has write access to the repo).
If you're open to it, a PR to https://gitea.com/gitea/terraform-provider-gitea would be very welcome and appreciated. Or, I could do it for you. Either way, thanks :)
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.
Hello @techknowlogick,
Thanks for the update. Sure thing I'll go over their and push these changes. I'll close this PR once complete.
Congrats @Lerentis 🥳
Hello @Lerentis ! |
Token scope was added to Gitea Tokens in V0.16+. The official Gitea SDK has not released a official version in 2years. The Implementation does exists in the default branch (Thanks John Olheiser).
Until the SDK has an official release of this feature it's not advisable to merge this PR into your provider.
But in the mean time, I've added this scope attr resource to be able to handle this new feature.
Updates:
scope
using Go-SDK for Gitea TokensWorkaround:
Install this branch locally with the existing makefile.
make install
and point provider to local install and operate terraform as usual.Example Usage: