Giter Site home page Giter Site logo

Comments (7)

twhiston avatar twhiston commented on June 24, 2024 1

I don't work as an engineer any more, so I have no stake in this feature now I'm afraid.

from gitlabform.

gdubicki avatar gdubicki commented on June 24, 2024

Hi @twhiston , sorry for a late reply!

I'll take a look at how much work would this require and get back to you.

We are of course open to getting PR with this too. Just let me know if you want to work on this so that we don't duplicate our efforts. :)

from gitlabform.

twhiston avatar twhiston commented on June 24, 2024

Hi @gdubicki , thanks very much for the response, not sure that i have the bandwidth to work on this myself atm (sorry i know that sucks!), but if no one else has time in the New Year I might try to jump on it. If you do make an assessment of the effort required please do share it on here. The easiest way to deal with it manually is to commit some dummy file content with the api so that the branch can be created (a generic readme in this case), so that is how we are working around it currently before calling gitlabform to apply the settings that we need.

Thanks for an awesome tool!

from gitlabform.

lukasmrtvy avatar lukasmrtvy commented on June 24, 2024

Should be possible via https://docs.gitlab.com/ee/api/branches.html#create-repository-branch api endpoint, would be nice to implement this in gitlabform.

from gitlabform.

amimas avatar amimas commented on June 24, 2024

I know it's an old post. Thought I'd leave my feedback on this feature request.

Do you still see a need for this feature @twhiston , @lukasmrtvy ?

I ask because we want to use it to keep our repo settings in line as people create repos in our namesapce, therefore the ideal flow would be:

repo created > hook fired > gitlabform run > master branch is created and branch protection enabled.

In my view, the above workflow doesn't make quite make sense. I assume people are creating repos in your namespace using Gitlab UI. I believe the default branch (i.e. main) is automatically created by GitLab and is also protected. So, I don't see why gitlabform would "create the protected" branch; unless your users are creating new repos using the option to not initialize the repo, which I imagine probably isn't the case.

There are also other feature request that seems to indicate if a branch doesn't exist, corresponding protection setting shouldn't be configured. Potentially these are conflicting requirement.

I'd probably tweak your workflow a bit differently. I used something like this:

  • Created a GitLab pipeline in a project that takes necessary input variable (i.e. project name, group id)
  • Users run this pipeline to create new project instead of doing it via GitLab UI
  • In this pipeline, project is created via GitLab's API
  • In the same pipeline, gitlabform runs after the project is created, which applies default config from the group level settings

Thoughts?

from gitlabform.

amimas avatar amimas commented on June 24, 2024

@gdubicki - should we close this issue since there aren't any activity and not many are looking for this feature.

from gitlabform.

gdubicki avatar gdubicki commented on June 24, 2024

Closing, but if anyone wants to actually implement this and discuss it first then please reopen!

from gitlabform.

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.