Code Monkey home page Code Monkey logo

Comments (12)

bkcsoft avatar bkcsoft commented on May 25, 2024 2

There are several most wanted features in gogs

@pyhedgehog Please make an issue for each (unless there already is one) so that the devs (myself included) are aware of the need πŸ™‚

from git-repo.

pyhedgehog avatar pyhedgehog commented on May 25, 2024 1

If there are no objections I'm going to implement this one.

from git-repo.

guyzmo avatar guyzmo commented on May 25, 2024 1

@bkcsoft well the two most important missing APIs (AFAICT):

  • fork a repository: gogs/gogs#3979
  • create a pull request: gogs/gogs#2253
    • one feature is very important to have is the ability to expose pull requests as git refs that can be fetched (on github it's like git fetch github pull/42/head).

and generally for feature completeness:

I'll leave @pyhedgehog make an issue about repository listing, as I'm not sure to the details of the repository listing limitations. Some other API might be nice to have (like the ability to list and push SSH public keys, or have oauth2 authentication).

from git-repo.

guyzmo avatar guyzmo commented on May 25, 2024

I got no objections, don't hesitate to ask for my help on anything. I wanted to work on it recently, as I started pushing to a friend's gogs, but I already got my hands full with both the gitlab and bitbucket integrations.
I'm also available on freenode on the channel #git-repo so please come and never hesitate to discuss the project.

from git-repo.

pyhedgehog avatar pyhedgehog commented on May 25, 2024

@guyzmo, I have) first version of code: #82
I have a question:
How I'm supposed to implement tests? Current tests (for other services) not working in my environment...

from git-repo.

guyzmo avatar guyzmo commented on May 25, 2024

for the tests, @pyhedgehog, please come back on IRC so we can discuss quickly what's going wrong.

from git-repo.

pyhedgehog avatar pyhedgehog commented on May 25, 2024

Just to log here results of our discussion:

  1. New version of PR should use third-party library (possibly gogs-client).
  2. There are several most wanted features in gogs and gogs-client:
  3. Features for proxy, private and ssl_verify should be implemented in service-independent manner.
  4. Test should be first-class thing. πŸ‘

from git-repo.

guyzmo avatar guyzmo commented on May 25, 2024

for the feature set, go by babysteps:

  1. implement first the already working features, like you first did (clone, create, delete, open, list) and consider that the user can copy/paste the token in the configuration file
  2. implement the token API as a second step, the best way would be for you to send a PR to gogs-client for them to integrate it, so then git-repo can merge it in!
  3. add the extra stuff we might want to have… You could make a PR to gogs to integrate the fork API, we can 🀞 that PR api lands soon… or you could implement some web scrapping (either in gogs-client or in a third part library extending gogs-client) to support those features.

About the configuration features:

  • ssl_verify is already implemented and I'm merging it in develop, just look for self.insecure on RepositoryService,
  • proxy support is a good thing to have (using the .gitconfig proxy setting), and I believe it's a good case for a new issue and PR, adding it for the four services.
  • private should be a command line argument git gogs foo/bar create --private. And there's already an issue to discuss default configuration implementation, but it's not a priority currently.

About the tests, I did my best to make them easy to write and run, of course I'm around if you need any help.

from git-repo.

guyzmo avatar guyzmo commented on May 25, 2024

FYI, I actually just checked with a gogs install, I believe it's possible to make a fork, given that the token auth works for this use case:

if you make a POST request with form data containing:

  • uid β†’ id of the new owner, i.e. current user
  • repo_name β†’ new name of the repository
  • description β†’ description of what is that repository

to the URL: /repo/fork/{id of the repository to fork} that should work!

N.B.: I believe there's a visibility parameter, but for my tests, I couldn't check as I was forking a private repository.

from git-repo.

guyzmo avatar guyzmo commented on May 25, 2024

implementation for tokens in progress over unfoldingWord-dev/python-gitea-client#2 πŸ‘

from git-repo.

guyzmo avatar guyzmo commented on May 25, 2024

BTW, in the module http_utils you'll have to have init create a requests.Session object and replace all requests calls with it. The patch should be fairly straightforward.

Also, we need to make sure that RelativeHttpRequestor (or the requests session within) is a singleton instance across the API lib β€” which I believe it is.

That's very important to have that in order to be able to write tests in git-repo.

from git-repo.

pyhedgehog avatar pyhedgehog commented on May 25, 2024

@guyzmo

if you make a POST request ... to the URL: /repo/fork/{id of the repository to fork} that should work!

How you've avoided Bad Request: no CSRF token present result?

from git-repo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.