Comments (6)
Hmm... I didn't realize earlier that the "Edit project" API endpoint had an
avatar
property. I was curious how that works. So, tried a few things usingcurl
. That API endpoint does allow updating project avatar like this:curl --silent --request PUT --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" --url "${GITLAB_API_URL}/projects/<PROJECT_ID>" --form "avatar=@${HOME}/Downloads/sample-logo.jpeg" | jq .The API for "Upload a project avatar" works the same way.
So, in theory the config you had is fine. But, I don't think gitlabform has logic to process that config because as you can see the
avatar
requires sending an image file to the API endpoint. And right now it's probably just sending the file path as string, which isn't what the api is expecting. That's probably why you're seeing that error about invalid value.
Oh I see. I haven't looked into gitlabform's code but maybe it is possible to use the curl to use the already available edit project endpoint when the avatar urls is used?
I don't know if im have enought knowledge about gitlabform to send a PR. Maybe in the future, but I think it a good feature to have.
Thank you for helping me, @amimas!
from gitlabform.
Hi. Could you please share a sample config you have tried?
from gitlabform.
Hi. Could you please share a sample config you have tried?
Yeah, no problem.
project_settings:
avatar: './my-photo.jpg',
description: |
Projeto de documentação
I tried putting a base64 image, svg, png. Searched some forums and the gitlab api docs but couldnt figure out the format that I should use.
from gitlabform.
Thanks for the sample config. What you tried won't work, regardless of value format. It comes down to Gitlab's API.
The project_settings
config uses Project API as per the gitlabform documentation. This API doesnt handle the project avatar.
Project avatar is managed by a different gitlab API. Gitlabform currently doesn't have support for it. PR is welcome though.
Would you be interested in implementing it? Let's discuss what the config should be like for this setting. This feature probably should also support deleting a project avatar.
from gitlabform.
Thanks for the sample config. What you tried won't work, regardless of value format. It comes down to Gitlab's API.
The
project_settings
config uses Project API as per the gitlabform documentation. This API doesnt handle the project avatar.Project avatar is managed by a different gitlab API. Gitlabform currently doesn't have support for it. PR is welcome though.
Would you be interested in implementing it? Let's discuss what the config should be like for this setting. This feature probably should also support deleting a project avatar.
Oh, ok. Thank you. Do you know what is the avatar prop in Project API? I think their documentation needs a fix, it kind of implies that it is possible to change the avatar from this api.
About the config file in my opinion, the easiest way would the passing a relative url of the image file.
from gitlabform.
Hmm... I didn't realize earlier that the "Edit project" API endpoint had an avatar
property. I was curious how that works. So, tried a few things using curl
. That API endpoint does allow updating project avatar like this:
curl --silent --request PUT --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" --url "${GITLAB_API_URL}/projects/<PROJECT_ID>" --form "avatar=@${HOME}/Downloads/sample-logo.jpeg" | jq .
The API for "Upload a project avatar" works the same way.
So, in theory the config you had is fine. But, I don't think gitlabform has logic to process that config because as you can see the avatar
requires sending an image file to the API endpoint. And right now it's probably just sending the file path as string, which isn't what the api is expecting. That's probably why you're seeing that error about invalid value.
from gitlabform.
Related Issues (20)
- Merge request approvals settings of group HOT 4
- Feature Flags support HOT 5
- Add retry feature HOT 2
- CI/CD settings: Whitelist project for Token Access HOT 1
- merge_requests_approval_rules does not respect protected_branches and breaks execution HOT 8
- [backward incompatible] Add ENTRYPOINT to the Dockerfile HOT 1
- Project transfer failing with --noop
- Error when output file flag is used with dry-run project transfer
- Add your company logo and link to the users list!
- Processing group fails if it has more than 20 members
- Add support for adding a single deploy key to multiple projects in a namespace/group as a non-administrator HOT 3
- Add 'enforce' support for integrations config HOT 3
- Drop python < 3.12 HOT 3
- KNOWN ISSUE: 3.11.0 has not been deployed to GitHub Packages (container registry) HOT 1
- GitLab 17.0 Issues HOT 1
- Incorrect order of gitlab API call for`members`, `merge_requests_approval_rules`, `branches` provided for a project HOT 4
- Project members setting ignores case
- Within the documentation site, the configuration link to "Group SAML links" page is missing on the left panel
- Migrate to hosting on GitLab HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitlabform.