gitlab-foss
v4 | gitlab-foss | |
---|---|---|
58 | 47 | |
- | - | |
- | - | |
- | - | |
- | - | |
- | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
v4
-
Crack the Code: Seamless Coverage Reports with Jacoco and S3 in GitLab CI
import concurrent import boto3 import os import requests import mimetypes from botocore.exceptions import NoCredentialsError S3_ACCESS_KEY = os.getenv('S3_ACCESS_KEY') S3_SECRET_KEY = os.getenv('S3_SECRET_KEY') S3_BUCKET = os.getenv('S3_BUCKET') S3_ENDPOINT = os.getenv('S3_ENDPOINT') CI_PROJECT_ID = os.getenv('CI_PROJECT_ID') CI_MERGE_REQUEST_IID = os.getenv('CI_MERGE_REQUEST_IID') GITLAB_TOKEN = os.getenv('GITLAB_TOKEN') COVERAGE_REPORT_FOLDER = os.getenv('COVERAGE_REPORT_FOLDER') CI_PIPELINE_IID = os.getenv('CI_PIPELINE_IID') CI_PROJECT_NAME = os.getenv('CI_PROJECT_NAME') S3_REGION = os.getenv('S3_REGION') s3_client = boto3.client('s3', aws_access_key_id=S3_ACCESS_KEY, aws_secret_access_key=S3_SECRET_KEY) def upload_file(bucket_name, dir_path, file_path, prefix, s3_client): relative_path = os.path.relpath(file_path, dir_path) bucket_key = f'{prefix}/{relative_path}'.replace('\\', '/') mime_type = mimetypes.guess_type(file_path)[0] if mimetypes.guess_type(file_path)[0] else 'application/html' extra_args = {'ContentType': mime_type, 'StorageClass': 'STANDARD'} try: s3_client.upload_file(file_path, bucket_name, bucket_key, extra_args) print(f'Uploaded file {file_path} as {mime_type}') except Exception as e: print(f'Failed to upload file {file_path} to bucket {bucket_name}/{bucket_key}: {str(e)}') def upload_dir(bucket_name, dir_path, prefix): with concurrent.futures.ThreadPoolExecutor() as executor: for root, dirs, files in os.walk(dir_path): for file in files: file_path = os.path.join(root, file) try: executor.submit(upload_file, bucket_name, dir_path, file_path, prefix, s3_client) except Exception as e: print(f'error: {e}') def add_merge_request_comment(gitlab_token, project_id, merge_request_iid, message): print('Creating a new merge request comment...') url = f'https://gitlab.com/api/v4/projects/{project_id}/merge_requests/{merge_request_iid}/notes' headers = {'Content-Type': 'application/json', 'Private-Token': gitlab_token} data = {'body': message} try: response = requests.post(url, headers=headers, json=data) response.raise_for_status() print(f'Merge request updated with coverage report access link.') except requests.exceptions.HTTPError as err: print(f'Failed to add a merge request comment: {err}') if __name__ == '__main__': pipeline_slug = f'coverage/{CI_PROJECT_NAME}-{CI_PIPELINE_IID}' try: upload_dir(S3_BUCKET, COVERAGE_REPORT_FOLDER, pipeline_slug) print('All files uploaded successfully.') access_url = f'https://s3.{S3_REGION}.amazonaws.com/{S3_BUCKET}/{pipeline_slug}/index.html' message = f'The coverage report is ready. Check it out [here]({access_url})!' print(message) add_merge_request_comment(GITLAB_TOKEN, CI_PROJECT_ID, CI_MERGE_REQUEST_IID, message) except NoCredentialsError: print('No s3 credentials found.') except Exception as e: print('Error:', e)
-
Manipulate Tags on Gitlab CI/CD
#!/bin/bash # list-tags.sh # List all Gitlab tags for a given project. # $CI_PROJECT_ID is a Gitlab pre-defined variable # $GITLAB_TOKEN is a project access token that needs to be # a defined CI/CD variable. GITLAB_API_URL="https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}" curl -k --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "${GITLAB_API_URL}/repository/tags"
-
Using semantic-release to automate releases and changelogs
# ~/.npmrc @doppelmutzi:registry=https://gitlab.com/api/v4/projects//packages/npm/ //gitlab.com/api/v4/projects//packages/npm/:_authToken=
-
403 Forbidden error when I tried to assign a user developer role using GitLab API through Python code
GITLAB_API_URL = "https://gitlab.com/api/v4" PRIVATE_TOKEN = "" NAMESPACE = "mycompany" PROJECT_NAME = "test-project"
-
Error 404 error while giving project access to a user for a developer role using the GitLab API in Python code
import requests app = FastAPI() # GitLab API configuration GITLAB_API_URL = "https://gitlab.com/api/v4" PRIVATE_TOKEN = "" PROJECT_ID = "vinod827_1391/awesome" def grant_developer_access(username: str): # Get user details from GitLab user_url = f"{GITLAB_API_URL}/users?username={username}" response = requests.get(user_url, headers={"PRIVATE-TOKEN": PRIVATE_TOKEN}) user_data = response.json() if not user_data: raise HTTPException(status_code=404, detail=f"User {username} not found.") user_id = user_data[0]["id"] # Grant developer access to the project access_data = {"user_id": user_id, "access_level": 30} # 30 is the access level for developer access_url = f"{GITLAB_API_URL}/projects/{PROJECT_ID}/access_requests" response = requests.post(access_url, headers={"PRIVATE-TOKEN": PRIVATE_TOKEN}, json=access_data) print('response->', response) if response.status_code != 201: raise HTTPException(status_code=response.status_code, detail=response.text)
-
Create tag with slash in name via API from PowerShell issue
Invoke-RestMethod -Uri "https://gitlab.com/api/v4/projects/12345/repository/tags" -Headers $headers -Method POST -Body $jsonBody
-
va_openDriver() error while trying to install Librewolf on Fedora39
Hello everyone i'm trying to install Librewolf on my M1 MBA running fedora39 with gnome on wayland, I downloaded librewolf's compressed archive from https://gitlab.com/api/v4/projects/44042130/packages/generic/librewolf/120.0.1-1/librewolf-120.0.1-1-linux-arm64-package.tar.bz2
-
Unable to install GitLab Package Registry
repositories { maven { url "https://gitlab.com/api/v4/projects/PROJEC-ID/packages/maven" credentials(HttpHeaderCredentials) { name = "Private-Token" value = gitLabPrivateToken } authentication { header(HttpHeaderAuthentication) } } } }
-
O navegador LibreWolf, uma versão modificada do Firefox é confiavel?
Pagina da Gitlab: https://gitlab.com/api/v4/projects/44042130/packages/generic/librewolf/116.0-1/librewolf-116.0-1-windows-x86_64-setup.exe
-
Extend hidden job not working in CI
.base: image: alpine:3.18 before_script: - echo "Project is $CI_PROJECT_NAME" script: - apk update - apk --no-cache add git openssl ca-certificates curl perl https://$GITLAB_USER_NAME:$SVC_ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git - mkdir -p /usr/local/share/ca-certificates/extra - openssl s_client -connect ${CI_SERVER_HOST}:${CI_SERVER_PORT} -servername ${CI_SERVER_HOST} -showcerts /dev/null | sed -e '/-----BEGIN/,/-----END/!d' | tee "/usr/local/share/ca-certificates/${CI_SERVER_HOST}.crt" >/dev/null - update-ca-certificates - curl --location --output /usr/local/bin/release-cli "https://gitlab.com/api/v4/projects/gitlab-org%2Frelease-cli/packages/generic/release-cli/latest/release-cli-linux-amd64" - chmod +x /usr/local/bin/release-cli - release-cli -v Versioning: stage: Version extends: - .base script: - if [[ "$CI_COMMIT_BRANCH" == *"feature/"* ]]; then IMAGE_TAG="nightly" ; elif [ "$CI_COMMIT_BRANCH" == "develop" ]; then IMAGE_TAG="devel"; else echo "Master/Main branch"; fi - echo "Version found is ${IMAGE_TAG}" allow_failure: false rules: - if: '$CI_COMMIT_BRANCH =~ /^(develop|main|feature.*$)$/' artifacts: paths: - $IMAGE_TAG expire_in: 1 minute
gitlab-foss
-
GitHub Actions Are a Problem
* Gitlab EE (enterprise edition) is closed, but Gitlab CE (community edition) is open source (https://gitlab.com/gitlab-org/gitlab-foss/)
* I didn't follow the Gitea drama too closely, but my understanding is that Forgejo was a fork born out of that situation
* I've heard the SourceHut guy is a controversial figure, so avoiding it because of that isn't unreasonable. I will just say that "spite forks" tend not to last very long
-
Server-Side Request Forgery in Rails
Gitlab uses an UrlBlocker class to prevent malicious users from exploiting SSRF via the webhook URL. This class validates the URL and blocks everything which is a local network, but before the 11.5.1 version, they didn't think about an IPv6 format, which maps to IPv4: [0:0:0:0:0:ffff:127.0.0.1]. Replacing the part of 127.0.0.1 to any IP address also worked, and this vulnerability made it possible to send requests to the internal network of a GitLab instance. You can read the issue report here: (https://gitlab.com/gitlab-org/gitlab-foss/-/issues/53242 )[https://gitlab.com/gitlab-org/gitlab-foss/-/issues/53242]
-
Automating deployment to kubernetes
I recommend Auto DevOps and hooking your project up to the Kubernetes cluster. Auto DevOps is a standard CI/CD template that GitLab uses by default when .gitlab-ci.yml is not present. It can automatically package up certain types of applications, including those with a Dockerfile in the root of the repo. If the project is hooked up to a Kubernetes cluster and all the right variables are present, it builds that docker image and then fills in a Helm chart template containing that image and deploys it to the cluster.
-
Beautifying our UI: Giving Gitlab build features a fresh look
Thanks. This was also requested for the UI 7 years ago
https://gitlab.com/gitlab-org/gitlab-foss/-/issues/12776
and then closed with the claim that this was implemented, when in fact, it was not.
-
How we cut down our CI build times by 50%
Similar to fsync, these are designed to ensure data integrity, but in a test setup, they don't matter. You can read more about these in the Postgres doc on non-durability. and explore some benchmarks from Gitlab here. Interestingly, CircleCI's old Postgres images had these features disabled by default, but the newer ones don't seem to.
-
Is Jenkins still the king?
Most all of those things are possible with Argo Workflows or Tekton with very great effort. But a sustainable system with all the features built-in.
- So weird, stage named test is not displayed in pipeline
-
Gitlab for FOSS reporting
If you wish to clone a copy of GitLab without proprietary code, you can use the read-only mirror of GitLab located at https://gitlab.com/gitlab-org/gitlab-foss/. However, please do not submit any issues and/or merge requests to that project.
-
Gitlab runners unable to clone over http(s) when git access set to SSH only.
GitLab versions 10.7 and later, allow the HTTP(S) protocol for Git clone or fetch requests done by GitLab Runner from CI/CD jobs, even if you select Only SSH.
-
No words v2💀
it sure does
What are some alternatives?
wireguard-windows - Download WireGuard for Windows at https://www.wireguard.com/install . This repo is a mirror only. Official repository is at https://git.zx2c4.com/wireguard-windows
gitlab
browser
CryptPad - Collaborative office suite, end-to-end encrypted and open-source.
charts
emacs - Mirror of GNU Emacs
git-repo-sync - Auto synchronization of remote Git repositories. Auto conflict solving. Network fail resilience. Linux & Windows support. And more.
taiga-docker - [Moved to: https://github.com/taigaio/taiga-docker]
AppMan - AppImage package manager to install, update (for real) and manage ALL of them locally thanks to "AM", the ever-growing AUR-inspired database listing 2000+ portable apps and programs for GNU/Linux. Manage your AppImages with the ease of APT and the power of PacMan.
cmark-gfm - GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C
gitlab-artwork
markup - Determines which markup library to use to render a content file (e.g. README) on GitHub