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

Add 'gitea_api' module and 'git-obs' executable #1599

Merged
merged 14 commits into from
Oct 11, 2024
Merged

Conversation

dmach
Copy link
Contributor

@dmach dmach commented Jul 8, 2024

TODO

  • print a proper error message when there's no default config entry
  • login list
  • login add
    • create directories, set secure perms
    • Implement --set-as-default
  • login remove
  • login update
    • Implement --set-as-default
  • ssh-key list
  • ssh-key add
    • validate that we're sending a public ssh key
  • ssh-key remove
  • clone
    • replace --directory option with an optional argument to get closer to the git clone command?
    • move under repo command
  • fork
    • move under repo command
  • make available as git obs subcommand

@pep8speaks
Copy link

pep8speaks commented Jul 8, 2024

Hello @dmach! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 226:121: E501 line too long (134 > 120 characters)
Line 240:121: E501 line too long (149 > 120 characters)

Line 73:121: E501 line too long (130 > 120 characters)
Line 90:5: E303 too many blank lines (2)

Line 31:121: E501 line too long (146 > 120 characters)

Line 36:121: E501 line too long (143 > 120 characters)

Line 72:121: E501 line too long (136 > 120 characters)

Line 38:121: E501 line too long (137 > 120 characters)
Line 56:121: E501 line too long (140 > 120 characters)

Line 47:121: E501 line too long (134 > 120 characters)

Comment last updated at 2024-10-11 11:13:56 UTC

@dmach
Copy link
Contributor Author

dmach commented Jul 8, 2024

@dcermak could you review the code and check if it works for you?

osc/gitea_api/repo.py Outdated Show resolved Hide resolved
osc/gitea_api/repo.py Outdated Show resolved Hide resolved
osc/gitea_api/exceptions.py Outdated Show resolved Hide resolved
osc/gitea_api/exceptions.py Outdated Show resolved Hide resolved
osc/gitea_api/repo.py Outdated Show resolved Hide resolved
@dmach dmach changed the title Add 'gitea_api' module Add 'gitea_api' module, add osc-git executable Aug 2, 2024
from .connection import GiteaHTTPResponse


class GiteaException(oscerr.OscBaseError):

Check failure

Code scanning / CodeQL

Missing call to `__init__` during object initialization Error

Class GiteaException may not be initialized properly as
method OscBaseError.__init__
is not called from its
__init__ method
.
osc/commands_git/fork.py Fixed Show fixed Hide fixed
@dmach dmach force-pushed the gitea_api branch 2 times, most recently from df3d828 to e5e3bba Compare August 2, 2024 13:35
@DimStar77
Copy link
Contributor

Is this mostly a re-implementation of gitea-tea to interact with a gitea instance?

@dmach
Copy link
Contributor Author

dmach commented Aug 21, 2024

Is this mostly a re-implementation of gitea-tea to interact with a gitea instance?

The basic functionality is going to be similar.
I'm planning to add interactive reviews similar to what osc has already
and some goodies to support the packaging workflows.
Those still need to be clarified.

IIUC @AdamMajer is working on a staging tooling that overlaps with this tool. We'll need to decide if we need both.

@AdamMajer
Copy link
Member

Interactive reviews should use "Issue comments" and "Pull Request Reviews" API to read and leave comments on a PR.

My ideal state is to use GPG signatures for approvals and not rely on Gitea as a secure record of this data. But we'll still need a tool to do actual review (ie. diffs) and communication.

@dmach dmach changed the title Add 'gitea_api' module, add osc-git executable Add 'gitea_api' module and osc-git executable Sep 20, 2024
@dmach dmach changed the title Add 'gitea_api' module and osc-git executable Add 'gitea_api' module and 'osc-git' executable Sep 20, 2024
behave/features/steps/podman.py Dismissed Show dismissed Hide dismissed
osc/commands_git/ssh_key_list.py Fixed Show fixed Hide fixed
osc/commands_git/ssh_key_remove.py Fixed Show fixed Hide fixed
osc/gitea_api/repo.py Fixed Show fixed Hide fixed
osc/gitea_api/repo.py Fixed Show fixed Hide fixed
osc/gitea_api/repo.py Fixed Show fixed Hide fixed
osc/gitea_api/repo.py Fixed Show fixed Hide fixed
@dmach dmach force-pushed the gitea_api branch 2 times, most recently from a9b0b16 to 9aa3fad Compare September 24, 2024 08:04
Copy link
Member

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

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

as discussed in the sync meeting, the extra binary should be called "git-obs" to have it callable via "git obs"

@dmach dmach changed the title Add 'gitea_api' module and 'osc-git' executable Add 'gitea_api' module and 'git-obs' executable Sep 30, 2024
@@ -35,6 +35,7 @@
from . import oscerr
from . import output
from . import store as osc_store
from .commandline_common import *

Check notice

Code scanning / CodeQL

'import *' may pollute namespace Note

Import pollutes the enclosing namespace, as the imported module
osc.commandline_common
does not define '__all__'.
@dirkmueller dirkmueller self-requested a review October 10, 2024 08:55
@dmach dmach merged commit 1d87e29 into openSUSE:master Oct 11, 2024
19 of 24 checks passed
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.

6 participants