Skip to content

Instantly share code, notes, and snippets.

View baymac's full-sized avatar
👋

Parichay baymac

👋
View GitHub Profile
[INFO] --- spotbugs-maven-plugin:3.1.11:check (spotbugs) @ gitlab-branch-source ---
[INFO] BugInstance size is 2
[INFO] Error size is 0
[INFO] Total bugs: 2
[ERROR] Unread field: io.jenkins.plugins.gitlabserver.credentials.PersonalAccessTokenImpl$DescriptorImpl.GITLAB_ACCESS_TOKEN_LENGTH; should this field be static? [io.jenkins.plugins.gitlabserver.credentials.PersonalAccessTokenImpl$DescriptorImpl] At PersonalAccessTokenImpl.java:[line 67] SS_SHOULD_BE_STATIC
[ERROR] Inconsistent synchronization of io.jenkins.plugins.gitlabserver.servers.GitLabServers.servers; locked 80% of time [io.jenkins.plugins.gitlabserver.servers.GitLabServers, io.jenkins.plugins.gitlabserver.servers.GitLabServers, io.jenkins.plugins.gitlabserver.servers.GitLabServers, io.jenkins.plugins.gitlabserver.servers.GitLabServers, io.jenkins.plugins.gitlabserver.servers.GitLabServers] Unsynchronized access at GitLabServers.java:[line 48]Synchronized access at GitLabServers.java:[line 111]Synchronized access at GitLabServers.java:[line 84]Sync
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running InjectedTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 40.508 s - in InjectedTest
[INFO] Running io.jenkins.plugins.gitlabserverconfig.casc.ConfigurationAsCodeTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.354 s <<< FAILURE! - in io.jenkins.plugins.gitlabserverconfig.casc.ConfigurationAsCodeTest
[ERROR] io.jenkins.plugins.gitlabserverconfig.casc.ConfigurationAsCodeTest Time elapsed: 2.354 s <<< FAILURE!
java.lang.AssertionError: Unexpected exception
at io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule.before(JenkinsConfiguredWithCodeRule.java:38)
at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:551)
@baymac
baymac / pom.xml
Last active June 18, 2019 00:49
POM for GitLab Branch Source
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.43</version>
<relativePath />
</parent>
<groupId>io.jenkins.plugins</groupId>
@baymac
baymac / gitlabbs.md
Last active November 30, 2020 08:09
Notes for GitLab Branch Source Development

GitLabSCMSource

  • Inside getRemote() method is the set variables in the uri template okay?

  • In retrieve(head,listener) using a different version of getBranch(project, head.getName()) and not supplying username like gitea plugin. Recheck if it still works.

  • Unable to get sha of gitlab mr head. No api call for that. So used mr.getSha() instead of mr.getHead().getSha().

^ Fixed it by getting the head sha by mr.getDiffRef().getHeadSha().

  • See how head is populated in retrieve(head,listener).
#include<ssss.h>
#include<Entropy.h>
#include <gf256.h> // Not Used
FamilyId id = {5, 2};
Ssss s;
void setup() {
Serial.begin(9600);
Entropy.initialize();
@baymac
baymac / Shortcuts.md
Last active August 19, 2019 13:45
Generally shortcuts I use
  1. Exit from JShell - /exit

  2. To release Jenkins plugin - mvn release:prepare release:perform

  3. Open markdown preview in vs code - ctrl + k then v

@baymac
baymac / PrintJSON.java
Created July 20, 2019 13:31
To print JSON from a httpserverletrequest in Java
StringBuilder sb = new StringBuilder();
BufferedReader reader = request.getReader();
try {
String line;
while ((line = reader.readLine()) != null) {
sb.append(line).append('\n');
}
} finally {
reader.close();
}
@baymac
baymac / gitlab-job-dsl.groovy
Last active December 8, 2022 16:43
A sample job dsl configuration of gitlab folder organisation
private boolean isSandbox() {
def locationConfig = jenkins.model.JenkinsLocationConfiguration.get()
if (locationConfig != null && locationConfig.getUrl() != null) {
locationConfig.getUrl().contains("staging")
} else {
System.getenv("ENVIRONMENT") == "sandbox"
}
}
List<Map> gitlab = []
@baymac
baymac / request.json
Created August 20, 2019 19:21
GitLab System hook request for repository update event
{
IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
@baymac
baymac / Parichay's feedback.md
Created August 27, 2019 11:43
A retrospective document of Jenkins GSoC 2019

Application period & Before

What did work well?

I started interacting on the community gsoc-sig gitter channel from May 3rd. It was nice and cordial response from the org admins and mentors. That really helped to be motivated and have confidence. We had frequent meet ups on hangouts. Everything was very professionally managed.

What should we improve?

I only think to improve the participants count and project ideas. We can embrace new tech stacks. The millennials are more inclined towards newer programming languages like Python, JS, Kotlin etc. This is also important for Jenkins to keep up with the pace. To take advantages of all the developments.