#JShell project for Tj-Bot!

1 messages · Page 3 of 1

timber mirage
#

anyway

#

have you managed to run it ?

bright lark
#

i have issues with antivirus

timber mirage
#
curl --request POST \
  --url http://localhost:8080/jshell/eval/test \
  --data '2+2'
#

try this as first request

timber mirage
bright lark
#

i tried to apply the generateapidoc command

#

it seems that the antivirus doesn't trust the source

#

so i get connection timeout error

timber mirage
bright lark
#

im trying to launch one api call

#

but i dnt know which endpoint to use first

bright lark
#

ah !

#

{
"timestamp": "2024-07-30T23:31:20.960+00:00",
"status": 409,
"error": "Conflict",
"message": "Session may have been forcibly destroyed.",
"path": "/jshell/eval/test"
}

#

this is probably due to docker container

#

im checking

timber mirage
#

What did you do ?

bright lark
#

i ran spring boot locally

timber mirage
#

show the images in your docker please

bright lark
#

ran the command

./gradlew :JShellWrapper:jibDockerBuild

timber mirage
#

do docker ps

bright lark
#

the image is ready; but no container

timber mirage
#

ah you are using this

#

so no container ?

bright lark
#

ye

#

i tried to run it

#

got error

timber mirage
#

do you have some log in the api ?

bright lark
#

o.t.j.service.JShellSessionService : Scheduler heartbeat: sessions ready to die: []
2024-07-31T00:34:46.330+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: started.
2024-07-31T00:34:46.330+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: sessions ready to die: []
2024-07-31T00:35:46.328+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: started.
2024-07-31T00:35:46.328+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: sessions ready to die: []
2024-07-31T00:36:46.337+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: started.
2024-07-31T00:36:46.337+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: sessions ready to die: []
2024-07-31T00:37:46.323+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: started.
2024-07-31T00:37:46.323+01:00 INFO 19224 --- [pool-2-thread-1] o.t.j.service.JShellSessionService : Scheduler heartbeat: sessions ready to die: []

#

do i have to use docker-compose to run ?

timber mirage
bright lark
#

why there is no command to run the container ?

timber mirage
#

wdym

bright lark
#

like docker run

#

i mean i ndocs

timber mirage
#

?

#

run which container ?

bright lark
#

run the image

timber mirage
#

which image ?

bright lark
#

u kidding me

timber mirage
#

there are at least two images in this project

bright lark
#

but u said that i only need docker for jshellwrapper

timber mirage
#

yes

bright lark
#

i could run springboot locally without docker

timber mirage
#

yes

bright lark
#

so 1 image

timber mirage
#

but you could also run the api in docker

#

so I am asking

bright lark
#

i know

#

now id like to only use docker for jshell as it's valid way

timber mirage
#

yes

bright lark
#

alright how to run jshell as container?

timber mirage
#

but why do you want to do that ?

#

why do you not want to use the api ?

bright lark
#

i did

#

but got nothing

#

oh hold on !

bright lark
#

it works

timber mirage
#

ah ?

timber mirage
#

show the output

bright lark
#

i don't know why earlier it didn't work

bright lark
# timber mirage show the output
{
    "snippetsResults": [
        {
            "status": "VALID",
            "type": "ADDITION",
            "id": 1,
            "source": "2+2",
            "result": "4"
        }
    ],
    "abortion": null,
    "stdoutOverflow": false,
    "stdout": ""
}
timber mirage
#

I don't know either since you didn't share anything about what you sent

bright lark
#

like the one u gave

#

well if the issue reappars, i'll let u know

timber mirage
#

right

timber mirage
#

perfectly

bright lark
#

alright, now i see what it is

timber mirage
#

note that it creates a session

#

that lasts 30 minutes

#

so if you send additionnal snippets

#

it will be one the same session

#

which means that you can use snippets endpoint to get the list of snippets

bright lark
#

i just tried it

#

it doesn't find snippet with id = 1

timber mirage
#

id is test here

bright lark
#
"message": "Id 1 doesn't match the regex [a-zA-Z0-9][a-zA-Z0-9_.-]+",
bright lark
timber mirage
#

well

#

it's the id of the session

#

.../snippets/test

#

and you will get the snippets of session test

bright lark
#

alright got it

#

it works too

timber mirage
#
  • note that there is an additional parameter that you can give to the eval endpoint, where you can specify the code of startup script, you can try for example CUSTOM_DEFAULT
#
  • there is also an additional parameter on the snippets endpoint where you can specify if you want to include the startup script
bright lark
#

(we need to write these information)

timber mirage
#
  • there is also a startup_script endpoint, where you can check the content of the startup script
#
  • there is also a single-eval endpoint where you can eval a script without creating a session
#
  • ah and I forgot, but you can omit the id on the eval endpoint, in such case it will generate a random one
#
  • and finally, a delete endpoint where you can force delete a session
timber mirage
#

anyway, play with it

#

if you have any question, ask me

bright lark
#

Alright

#

Thank for the information, we neee to collect them in readme

timber mirage
#

So the bug happened again, but I forgot to add debug level -_-
So here are the logs, at least we have a bit more information, and I am going to restart it with the correct log level

#

@bright lark @sterile crest @compact holly

#

Alright, I restarted and used debug level, it is working

#

We will really need to simplify the api

timber mirage
#

Also

bright lark
#

Whatsp guys

#

Im in holidays

#

I'm following the progress

#

But can't develop anything

#

🏊‍♂️

#

Will come back in 4 days

sterile crest
#

I'll remove Spring and the rewrite the docker integration

#

Which is basically rewriting the entire thing nevermind

#

Might as well use my lambda that is currently running and hasn't gone down, is unrestricted, no bugs pepekek

bright lark
#

Simplify doesn't mean full refactor

#

Also, i like spring and i think it's helpful for rest api

#

What i dn't understand yet is: how discord communicates with rest api to fire actions

sterile crest
#

It uses web sockets

#

Jshell isn't a discord bot, it's an API for TJ bot

bright lark
#

So tj bot consumes jshel api

#

?

sterile crest
#

Yeah but if you couldn't understand that from the 5 java files doing that interaction then how can you say having spring is good?

bright lark
#

I didn't take full look on the cosebase (jshel api)

#

But i assume it's possibel to simplify stuff

#

Spring is mature, spring boot is magic

#

What would u do without spring?

sterile crest
#

Then again, I don't really wanna have this conversation

#

If you wanna jerk off to spring go for it 🤷

compact holly
#

it's the other way around

#

what would the spring do without me? gigachad

sterile crest
#

Ever noticed that people don't use the tools provided spring?

#

Eureka? Lul they use consul

compact holly
#

spring isn't that important argument atm

sterile crest
#

Use thymeleaf? Lul you suck

#

Nah

compact holly
#

firas should take the engineering approach, take a deep dive at the code, get familiar, fix some bugs

#

and only then, to actually think and propose engineering solutions

#

with good argumentation

#

we are not just throwing random tech at projects

#

engineering is not about throwing random abstract ideas without any domain knowledge

#

like "hmm, about that bug.. what if we reworte the whole thing in rust?" is not helpful

#

even when you are knowledgeable, ideas are cheap

#

we all have a lot of cool ideas

#

it would be cool to have flying cars (via jet engines), that drive themselves with AI

#

what we are looking for are actual concrete engineering solutions, that someone is willing to implement

#

that satisfy all our requirements

#

(if you don't know the requirements, you can't even start thinking about the solution)

compact holly
#

and from my understanding it doesn't have the feature parity

#

and it having no bugs and not going down is expected, since it's not used in production

#

ala also thought his solution had no bugs and is not going down, so that is not that reassuring to me

#

but yeah, it's a possible solution we could migrate to

#

we should also analyze flexibility of such solution, currently we have a lot of freedom to do whatever we want

#

(we basically made aws lambas ourselves, on our own infrastructure, and sky is the limit)

compact holly
#

but good maintainability and reduced complexity, is something we tend to favor over flexibility

sterile crest
#

For another discord server

#

I've literally already cloned our jshell command

#

For another server

#

The better part is that everything is managed via the bot

#

And the jshell service is purely only used to invoke code in jshell

#

So you manage the sessions and all that jazz you wanna do in your own code and not externally (like in the jshellbackend)

#

And I can show you the price breakdown

#

It's free

#

But I have actual graphs n shit

compact holly
sterile crest
#

OOP

bright lark
#

Yes we can employ these too

compact holly
sterile crest
#

No I'm just saying random buzz words

bright lark
#

To me spring boot helps

sterile crest
compact holly
#

what do we lose on feature parity and flexibility?

#

are sessions a possibility?

#

that is a big feature, that you can just continue wth your personal repl session

sterile crest
#

what's a session really? Map of used commands?

#

the execution state?

sterile crest
#

the only thing we might lose out on is history of execution

bright lark
#

Hmm

sterile crest
#

e.g. if you did /jshell int i = 0; that won't persist

compact holly
#

i'm aksing about all the drawbacks of the solution, so I can have the full picture ^^

sterile crest
#

that's the only downside

compact holly
#

so can we just swap it without losing any current functionality?

sterile crest
#

i.e.

#

/jshell sysout(i)

#

wont work

compact holly
sterile crest
#

well it can if we internally keep a record of the history and anything that was successful re-run it each time

compact holly
#

like you have in your own local jshell

sterile crest
#

so with each request provide the history

compact holly
#

you can define something and use it later

sterile crest
#

yhhh

bright lark
#

I dnt understand sir

compact holly
#

define multiople methods, and then show helpee the difference

bright lark
#

And this is too quick

compact holly
#

beign able to easily play with it

#

with short neat examples

sterile crest
#

do u you want the URL?

#

just play with it

compact holly
#

but yeah, my position here is to play the devils advocate

#

so I want to know all the drawbacks and costs

#

to make sure we are making a sound decision

bright lark
#

Wait please

#

We need to evaluate the current impl of session

#

I see it cool

#

Why would we change it?

compact holly
#

yes, no worries, that's my job :p

sterile crest
#

output is:

#
{
    "errorStream": "",
    "outputStream": "hello",
    "events": [
        {
            "statement": "System.out.println(\"hello\");",
            "value": "",
            "status": "VALID"
        }
    ]
}```
compact holly
#

we already have a working solution that we invested into, and we need a good reason for a rewrite and completely different solution

#

it's enticing and sexy, I just need to know the exact drawbacks :p

bright lark
#

if it has drawbacks, it should be demonstrated somehow

timber mirage
bright lark
#

Ah is it performance issue

sterile crest
#

time and persisted execution history is all i can see

sterile crest
timber mirage
#

Guys

#

It's getting annoying

sterile crest
#

well yes technically, but's a new docker container per request (if we compare it to the current implementation)

bright lark
#

Gotta go to bathroom 🛀

timber mirage
#

Each time there is a discussion @sterile crest you start talking about your solution which we said we won't use and it goes into hundreds of message

bright lark
#

Will come back

compact holly
#

it's not just a new docker container

timber mirage
#

please stop flooding this channel

compact holly
#

the beauty of docker containers is that they are just linux threads, there is no performance downgrade

sterile crest
compact holly
#

it's just a thread with some cgroups and namespaces to restrict it

sterile crest
#

but i get ittt

compact holly
#

nah, discussing it is fine, if it's a clearly better solution

#

we could switch

sterile crest
#

i would so use my thing for a /linux command

compact holly
#

lambdas are kidna made for this type of thing

timber mirage
compact holly
#

it's so easy to maintain, since we don't maintain anything

timber mirage
#

so please stop

compact holly
#

we outsorce the infra

timber mirage
#

like

compact holly
#

nah, don't insult the current soluton either peepo_happy

timber mirage
#

95% of messages here are about your project, that's not normal

compact holly
#

it goes nowhere, and the solution is cool peepo_heart

#

just create an issue where we can properly discuss it, all the points I mentioned

#

discord discussions lead to nowhere

sterile crest
timber mirage
compact holly
#

nobody wants to talk about any solution :p

#

well, people only talk, that's the main issue

#

jshell issue was open for years

sterile crest
#

like with the logging

sterile crest
compact holly
#

but you are the only ones

timber mirage
compact holly
#

and you are here basically because you wanted to make it happen for ala birthday, because he was asking for it for months

sterile crest
timber mirage
compact holly
#

to make sure we make good engineering decisions

timber mirage
#

anyway

sterile crest
#

he's still one of the highly respected people here in tj

#

who helps everyone

compact holly
#

I don't have time for actual impolementation/review/tests

timber mirage
#

There are many improvments we can do in the implementation of the api

compact holly
#

but I must have time when someone is proposing a rewrite and completely alternate soltuion

sterile crest
#

@timber mirage i approved ur PR but I don't think it'll help with anythign

compact holly
#

to make sure our efforts are focused

compact holly
#

and we will see

#

these discord discussions lead to nowehere

timber mirage
compact holly
#

it's not actionable

#

so for now.. maybe?

timber mirage
compact holly
#

you would have to read the discussion

#

wazei read it, so he knows what i'm takling about

sterile crest
#

fix the conflict @timber mirage

timber mirage
#

@sterile crest note that on top of improving the API (I mostly think about the stop/close code which starts to be very complex for no reason)
We will need to fix docker problem because docker does some random stuff all the time, and the lib we are using makes it even worse

timber mirage
sterile crest
#

it's not the lib itself, i think it's how we're using it

timber mirage
#

nah

#

it's the lib itself

#

well

#

it's both

sterile crest
#

package com.javadiscord.bot.commands.linux.docker;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.CreateContainerResponse;
import com.github.dockerjava.api.model.HostConfig;

public class DockerContainerCreator {
    private final DockerClient dockerClient;

    public DockerContainerCreator(DockerClient dockerClient) {
        this.dockerClient = dockerClient;
    }

    public CreateContainerResponse createContainerStarted(
            String name,
            String image,
            long memoryLimit,
            long memorySwapLimit,
            int cpuShares,
            long cpuPeriod,
            long cpuQuota) {

        CreateContainerResponse createContainerResponse =
                createContainer(
                        name, image, memoryLimit, memorySwapLimit, cpuShares, cpuPeriod, cpuQuota);

        startContainer(createContainerResponse.getId());

        return createContainerResponse;
    }

    public CreateContainerResponse createContainer(
            String name,
            String image,
            long memoryLimit,
            long memorySwapLimit,
            int cpuShares,
            long cpuPeriod,
            long cpuQuota) {

        HostConfig hostConfig =
                HostConfig.newHostConfig()
                        .withAutoRemove(true)
                        .withInit(true)
                        .withMemory(memoryLimit)
                        .withMemorySwap(memorySwapLimit)
                        .withCpuShares(cpuShares)
                        .withCpuPeriod(cpuPeriod)
                        .withCpuQuota(cpuQuota);

        return dockerClient
                .createContainerCmd(image)
                .withHostConfig(hostConfig)
                .withStdinOpen(true)
                .withName(name)
                .exec();
    }

    public void startContainer(String containerId) {
        dockerClient.startContainerCmd(containerId).exec();
    }
}```
#
package com.javadiscord.bot.commands.linux.docker;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.ExecCreateCmdResponse;
import com.github.dockerjava.core.command.ExecStartResultCallback;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;

public class DockerCommandRunner {
    private final DockerClient dockerClient;

    public DockerCommandRunner(DockerClient dockerClient) {
        this.dockerClient = dockerClient;
    }

    public OutputStream sendCommand(Session session, String command) throws InterruptedException {
        session.updateHistory(command);

        OutputStream output = new ByteArrayOutputStream();

        ExecCreateCmdResponse execCreateCmdResponse =
                dockerClient
                        .execCreateCmd(session.getContainerId())
                        .withAttachStdout(true)
                        .withAttachStderr(true)
                        .withCmd("bash", "-c", command.trim())
                        .exec();

        dockerClient
                .execStartCmd(execCreateCmdResponse.getId())
                .exec(new ExecStartResultCallback(output, output))
                .awaitCompletion();

        return output;
    }
}
#

that's literally all it is

#

2 files

#

all we need

timber mirage
#

Often when a container is destroyed, for example, random stuff happen with the lib

#

Like for example the error from last time

#

but it's not the only one

sterile crest
#

yeah that could be specific though which I haven't seen personally - so I can't speak on that

#

but like our code has too much happening is where i'm pointing at

timber mirage
#

because sometime an error appear in a docker lib thread so there is no way we can do something for it

sterile crest
#

my code above to create a container is 100x less complex than what instan did

timber mirage
#

or other times, there is the pipeline broken error

#

that seaminly appears randomly

sterile crest
#

it was a big refactor i was gonna but it's kinda involved

#

i rather we debug and fix now

#

which is why i said i rather re-do the spring and docker implementation

#

but it's a massive piece of work

#

even the spring bit, if it was a bit more OOP then maybe but it's a mess rn

#

hard to approch

#

so the trade off isn't worth it at this moment

#

might be worth it once we know jshell is 100% working without bugs

#

then we can improve

#

but its also why i say go use lambdas because then we can remove that heavy lifting logic entirely and focus on the feature itself

#

but that won't happen now

#

it's a step backwards to go in the right direction but too many opinons

compact holly
sterile crest
#

it's mine

#

i wrote it 😄

#

for my /linux poc that I did in an hour

compact holly
#

yeah, what i'm saying I don't what your /lunux poc is, I assume your jshell implementation on another bot

#

that uses docker, and which api?

sterile crest
#

it's running a 5min linux session in discord

compact holly
#

so this is another alternative solution

#

but using docker? :D

sterile crest
#

i mean

#

i did it for #server-suggestions message

#

but you guys didn't want it

#

so i donated it 😄

#

here's the code if u want it

#

the POCs are all there

compact holly
#

it's not that I didn't want it, it's just that im the final boss you have to beat to have your idea implemented

sterile crest
#

wym

compact holly
#

otherwise we would have nsfw animu girls waving on the server, or god knows what

sterile crest
#

i could easily push it and my fans would approve the PR

#

you'd wake up one day and it's all magical

compact holly
#

you have to defeat all the arguments against it, to have it on here

sterile crest
#

i don't wanna do this in ala's thread

compact holly
#

so to stop people from downloading cp on our server, or to stop people from installing qbittorent and torrenting

sterile crest
compact holly
#

to make sure it's super secure and contained, and people can't use some exploit via file system access

#

etc

sterile crest
#

it's non-persistent

compact holly
#

I know, i was spekaing about /linux command hosted on our docker infra

#

so it's not that I hate or dislike the ideas

#

it's just my job to make sure we don't get arrested, and we don't become terrorists by accident

#

I like ideas, and discussing all this is good

sterile crest
#

it's a superficial concern because containers don't persist i.e. they are cleaned up after 5 mins and well if you misconfigure docker thats on you

#

but it's the same with jshell

#

if we did jshell wrong, it's a prolem

compact holly
#

my advice is to do in i issue, present idea well, with all the advantages and disadvantages

sterile crest
#

so it's all config rather than the implementation itself

compact holly
#

and we can decide on it conclusively

#

not just me an you in some random discord thread

sterile crest
#

but i'm no longer marketing /linux here

compact holly
sterile crest
#

i'm gonna make it a premium bot

#

sell it 😄

#

if nobody wants to adopt it while it's free 😦

compact holly
#

we can't adopt it, since it's not our project, and it's not open-source

#

but yeah, just make a good case about it, and it's fine peepo_happy

sterile crest
#

i don't wanna anymore 😐

#

either you take it or you don't 😄 😄

#

but for now, we can work on jshell

#

and fix these issues

#

it's something to pass the time anyway, even if there are other solutions

#

i just wish it was planned and documented

compact holly
#

create an issue on tj-bot, outline everything and we can decide which path to take ^^

sterile crest
#

from the beginning

#

the pr-notifications for projects is doing better though

#

we trialed 3 different ways

#

2 SDKS, natively calling the API

compact holly
bright lark
#

It would be better to draw a diagram

compact holly
# sterile crest from the beginning

yeah, this project is not done in the same way tj-bot is, where we are super strict, everything is documented, reviewed by multiple pleople, etc

bright lark
#

That shows components and flow

sterile crest
compact holly
#

there was a reason why I avoided being the only one to bring it online :p

#

I knew it wouldn't be as easy and smooth as it looks

#

but also because I don't want to be the only person that is able to maintain it

#

that's one of the big issues i'm trying to solve, with creating multiple teams

sterile crest
#

the good thing is that we have 2 new people that can login to the vps and that know the infraa

compact holly
#

and having more people involved, 'activated', confident and able to do stuff on theri own

#

yes, that was the goal peepo_happy

#

also this project is basically insvisible, and doesn't have any activity except us here

#

it requires a lot of work to make these things happen

sterile crest
#

skill issue all mine have visibility

compact holly
#

if any of you give up on it, it's a dead unmaintainable project

compact holly
#

and time

sterile crest
#

it requires getting people interested in the concept

#

and making it, well

#

fun.

compact holly
#

that's the easier part

#

harder part is keeping them interested

#

whent the initial buzz fades

sterile crest
#

it's because we have no good issues on the project

#

if TJ bot only had issues noted on discord, then nobody would contribute

compact holly
#

yes, one of the 10 problems project has :p

#

that I outlined from the beginning

#

also if I remember my advice on that game project idea you guys had

#

open a bunch of accessible and easy to implement issues, label them properly

#

do stuff on github

#

good readme and docs

#

etc etc

sterile crest
#

look at our java discord framework board

#

so nice and easy

compact holly
#

yeah, you need issues that are bite-sized

#

so someone new can be like 'oh, I could do that'

#

and make contributing fun and easy

sterile crest
#

yeah exactly

compact holly
#

and that's the domain i'm concerned with mostly

sterile crest
#

but the content too

compact holly
#

because my job is top level issues

sterile crest
#

the best quality issue on TJ 😄

compact holly
#

what you guys do, how you implemented it, which features and reviews and code..

#

taht's all well and good

sterile crest
#

user story

#

context

#

considerations

#

whats not in scope

#

acceptance criteria

#

sample code

compact holly
#

yeah, that's how you do it ^^

sterile crest
#

and 4 people wanted to pick it up

#

and we managed to trial 3 ways to implement it

#

by 3 different people

compact holly
#

and on the other side, there is a reason nobody wants to touch jshell

sterile crest
#

it's not really a junior/intermediate project

compact holly
#

(of 5 people that even head about it, and opened the repo)_

compact holly
#

and not talking just about the code here

#

all other parts are more improtant than code itself

sterile crest
#

we experts can barely work on it peepoW

#

there's a lot of knowledge needed

#

spring, docker, jshell, java

#

the docker part requires really involved knowledge

#

if you close your eyes, you don't need to look at Spring

compact holly
#

yeah,d epends what you are familiar with

#

but my main point is that only 20% of project is code

#

you could make it fun and have people test the code well before deployment

#

for example try to crash or hack it challange, with rewards

#

or someone to write docs, diagrams, javadocs

#

or someone to write tests for existing code

#

or someone to read logs, and create issues based on those

#

to report bugs

#

with maybe some directions where to look at

#

or just users, that will use it around the server, and more people will start using it, and being exposed to it

#

create small issues, and guide people, create good docs how to set up and write basic feature

#

so you can have your first contributors that you will help and cheer for

#

you share knowledge via code reviews, so there are always at least few people familiar with it, can maintain and guide newcomers

#

and of course making sure it's visible on many different platforms, invite people, do the social/marketing part, make it fun etc

#

sustainability and maintenance is much more important to me than some specific implementation

#

especially for a community where people come and go, and open-source software with no paid devs

timber mirage
#

<<<<<<< feature/SessionsStats
Instant start = Instant.now();
if (!code.endsWith("\n")) code += '\n';

    if (!code.endsWith("\n"))
        code += '\n';

develop

#

🤔

#

pretty sure one of them should be flagged by the linter no ?

sterile crest
#

what linter, you just have spotless

#

and maybe spotless:check isn't doing anything special

#
    spotless {
        java {
            targetExclude("build/**")
            endWithNewline()
            removeUnusedImports()
            // empty string '' covers all imports that aren't explicitly specified,
            // we use it as catch-all for external dependencies like JDA
            // '\\#` is prefix for static imports
            importOrder('','org.togetherjava', 'javax', 'java', '\\#')
            // TODO: pinning version because of spotless error https://github.com/diffplug/spotless/issues/1992
            eclipse("4.31").configFile("${rootProject.rootDir}/spotless.xml")
        }
    }
#

it's not really doing anything

timber mirage
sterile crest
#

eclipse thinks everything is correct lul

#

i prefer the google aosp format personally

compact holly
#

build should fail on both by sonar, because there are no brackets LUL

#

these are not python godless lands

#

but seems like there aren't any automated pipeline checks

#

it's unclear if spotless is even ran

#

there should no be formatting merge conflicts tho (if ci/cd pipeline works)

#

only if you manually introduced them

compact holly
#

there isn't anything on that PR

#

so it's wild west

sterile crest
#

the entire repo has nothing setup besides the pre-commit that does gradle build

compact holly
#

yeah, so it's not a sonar or spotless issue

sterile crest
#

it's spotless allowing both varients

compact holly
#

since those tools are not even used LUL

sterile crest
#

eclipse is ok with it

sterile crest
compact holly
#

depends how you configure it

sterile crest
#

yeah i posted the config

compact holly
#

nobody guarantees build is ran

#

so there are no guarantees spotless is ran

sterile crest
#

yes there is

compact holly
#

there are no forced ci/cd checks

sterile crest
#

there's the GHAs

#

wym

compact holly
sterile crest
#

oh

#

nevermind

#

spotless did fail

#

lolol

compact holly
#

yeah

#

these things are deterministic, it's easy to know what happened and why

#

otherwise automating would be useless

#

but that's accidental spotless run that fails the build

compact holly
#

there are no guarantees spotless is ran locally

timber mirage
sterile crest
#

yeah there isn't

compact holly
# sterile crest no

what i'm saying is, there should be seperate actions that deal with each of these things

timber mirage
sterile crest
compact holly
#

not sure what correct means

#

but we tried to make it automatic, so nobody ever has to deal or think about formatting

#

and that is done mostly with success

sterile crest
#

if you're talking about a pre-commit hook

#

then that's missing

compact holly
#

sometimes people manage to avoid our automatic spotless run

sterile crest
#

but we have the tool to stop PRs merging with that pre-commit.yaml that runs gradle build

compact holly
#

in regards to spotless allowing both, it's very configurable, you can make it do whatever you want

compact holly
#

it happens after pushing

#

but yeah, that's something

#

what i'm saying, it's much friendlier if all of these tools have individual actions

#

so people know what failed

#

with individual logs

#

and ideally, you know this before you push

compact holly
#

what's why there is pre-commit on tj-bot, that automatically runs spotless

#

and there is a guide to install sonarlint locally and synchronize with our sonarcloud

#

so you get there issues in realtime

#

it's kinda annoying to push, then go fix 20 different issues system raised

#

push again

#

there are new ones.. LUL

compact holly
#

it's annoying for both users and reviewers

sterile crest
#

then locally on your machine just do pre-commit install

#

and it'll install the git hooks

compact holly
#

ye, many ways to do it

#

we automatically install pre-commit hooks, to make it easy to newcomers

sterile crest
#

i hate that 😄

compact holly
#

I kinda disagree with it otherwise, philosophically

#

forcing something user is not even aware of

sterile crest
#

i remember when i first used tj bot

#

i was like where tf did this come from

#

and then i saw it in gradle...

#

and was like "ahh"

compact holly
#

yeah, it's act of terrorism :p

#

but we use quite a lot of tech

#

and we want newcomers to just work without all these issues

#

a lot of our newcomers don't even know how to solve merge conflicts, or use git

sterile crest
#

i have a love/hate with the auto rebase too

compact holly
#

also why gradle on our projects automatically donwloads jdks, and setups up erverything you need

#

so you don't even have to install java

#

(and to install correct version, configure intellij in 3 different places to use correct java version... etc)_

sterile crest
#

(doesn't work on intellij)

#

maybe because of my settings which are suited for me

#

gradle build isn't the first thing I do

compact holly
#

a year or two ago when i set it up, intellij didn't fully respect it

#

because it was a new tech

#

there was intellij issue trying to address that

#

not sure where it went

#

but yeah, we had a lot of problems because of intellij just not respecting our built settings

#

and doing it's own thing

#

also some people had intellij configured in a way to ignore pre-commit hooks (possibly a default)

#

kinda wild, since whole point of a build tool is to have all these things determinsitc

#

and same on each machine

#

but whatever

sterile crest
#

my intellij is setup to directly ignore those types of settings

#

because i hate behind the scenes stuff

compact holly
#

yeah, I just use ./gradlew

sterile crest
#

i don't

compact holly
#

I can't deal with intellij or other tooling injecting some random shit in my commands

#

i also use git in terminal

sterile crest
#

i do in some projects have it set to use the wrapper but in others i don't

compact holly
#

it's wild what some gui buttons do

sterile crest
#

i can't git without intellij lmfao

#

how do i rebase, commit, push, pull, update whaat are these commands!!

#

oh intellij click on branch > update

#

nice cool

#

click on branch > rebase

#

ez

#

but i'm also a windows user... so gui is life

compact holly
#

i remember laughing at this issue

#

that I actually had to recover my drive by accidentally clicking that button (doing secret and nuclear git clean in background..) on my home

#

it gobbled all my home as git source directory

sterile crest
#

bs code!!

compact holly
#

and I was like don't do that you stupid piece of shit, looking for X to cancel/discard

#

there wasn't option like taht

#

so I clicked discard button

#

oh my LUL

#

it even crashed trying to fuck up 100gb of my drive

#

that was first time I clicked GUI git button, and the last time

#

that was wild experience, git clean is extremely nuclear command

#

and I had no idea

sterile crest
#

intellij is good though, it has a "recycle bin" and local history

compact holly
#

usually gui software never even touches your actual file system

sterile crest
#

git reset --hard main your branch that has 3 months of changes that you didn't commit? np, we have you covered 😉

compact holly
#

X/delete etc work logically

#

you just remove it from your screen, but not your drive

#

or yeah, recycle bin, you can undo it.. etc

timber mirage
compact holly
#

because it's logical

compact holly
#

there is one git command pinned in #tjbot-discussion that everyone uses LUL

bright lark
#

Whatsp

timber mirage
compact holly
#

a soft reset

sterile crest
#

gets ur branch upto date with main

#

deletes ur commits

#

but keeps the changes on ur machine

compact holly
#

i prefer it hard tho peepo_mhh

sterile crest
#

so u can commit cleanly at the end

sterile crest
#

the past few days have been extra sus

#

but it's okay, nothing wrong with it

#

we still love you

sterile crest
#

it's just what works for me

bright lark
#

I feel discussion here isn't effective

#

U talk about offtopic stuff too much

sterile crest
#

yeah true

compact holly
#

indeed

bright lark
#

Im lost

compact holly
#

we are the only ones here tho peepo_happy

sterile crest
#

it's better here than #tjbot-discussion

timber mirage
sterile crest
#

i suck at cli

#

intellij wraps me in a warm blanket when i do any development peepo_comfy

bright lark
#

U can use the git console tab to learn how it uses cli

#

U benefit from both

#

(damn why we dnt talk about jshell anymore)

sterile crest
timber mirage
sterile crest
#

it was on topic with the repo settings

#

so we need to setup sonar

#

if you guys don't know how to then it would be a great learning experience to start getting involved

bright lark
#

Alr for code quality

#

I think that a most prior task is to set up a clear documentation in readme

#

To get started

#

Alathreon and i had very good onboarding yesterday

sterile crest
#

sounds good, if you raise a PR then we can review it

bright lark
#

Im actually in holidays now

sterile crest
#

nice

bright lark
#

dnt have laptop, But the project is interesting

#

I want to follow the progress with mobile

#

Then, we takle bugs

#

I think they arent many

#

Once those are fixed we move to enhancements and features

sterile crest
#

wise words of wisdom firas

compact holly
#

firas solved the whole thing, from mobile, on his vacation

#

basically oriented us for the next 3 years

#

firas could be our CEO

#

after we finish all the enchancements and features

#

we sell it to everyone, and become bilionaires peepo_happy

bright lark
#

Next, we set contributing guidelines

sterile crest
#

i'm really excited for the movement to cloud firas

timber mirage
compact holly
#

i'm interested in becoming at least millionaire

#

what do you think are the next steps 🍾

timber mirage
#

Let's say that we indeed aren't doing in bug quntity, but we are doing in term of bug quality...

compact holly
#

what the fuck is that emoji

sterile crest
bright lark
#

Yea but i thought it's impossible

timber mirage
sterile crest
compact holly
#

nah, fuck azure

#

how to we monetize tj, to become rich firas peepo_happy

#

focus on the monies

bright lark
#

I ve contacted some engineers i know they collab alot of azure techs

sterile crest
#

that's the real win

compact holly
timber mirage
#

Please

#

stop going off topic

#

It's like

bright lark
timber mirage
#

the 3rd time

#

in a row

sterile crest
#

sorry ala

timber mirage
#

95% of messages in this channel are offtopic

bright lark
#

I want to stay in topic

sterile crest
#

me too

bright lark
#

Alright, lets have a good roadmap for jshel

sterile crest
#

yep, what tool should we roadmap with?

bright lark
#

As i said earlier

#
  1. Set getting started guide
timber mirage
sterile crest
#

but if we're road mapping then we need to set timelines

compact holly
#

that requires work tho

#

ye, but for timelines

#

we have to do track time

bright lark
#

Alr but we need to provide welcoming atmosphere to others

compact holly
#

otherwise we won't know how much time we spent on the issue, nor how much to bill the client..

bright lark
#

Thats with readme, and contributing guide

compact holly
#

we need time tracking software

timber mirage
compact holly
#

any recommendations for linux?

sterile crest
#

it'll get lost in the chat

timber mirage
#

We have issues

#

on github

sterile crest
#

only 6 issues?

timber mirage
#

and it's not like it is complicated

compact holly
timber mirage
#

we fix bugs

bright lark
#

I just saw the recent issue on gh, good

sterile crest
#

i an fix all 6 issues before i go to bed

timber mirage
#

no

sterile crest
#

i only see tech debt here

compact holly
#

we just have to clean up and improve the project

timber mirage
compact holly
#

and question if we should add functional tests

bright lark
#

Also, set up some tests to avoid regressions

sterile crest
compact holly
#

right, can't forget about regressions

sterile crest
#

i can do this in 15 mins

#

this is nothing

#

what sonar warnings bro

#

we don;'t have sonar

compact holly
#

maybe we should split it in multiple issues

#

i can tackle the deletion

timber mirage
# sterile crest

Ah well, all those points are already done
I meant to fix the current approach with calling docker

sterile crest
#

make an issue for it

timber mirage
#

right

sterile crest
#

with lots of detail please

compact holly
#

firas will make the charts

sterile crest
compact holly
#

what tool for chating we should use?

sterile crest
compact holly
#

that is multiplatform and foss?

#

charting*

bright lark
compact holly
#

art of creating pleasing charts

sterile crest
#

do we need a jshell logo@?

bright lark
sterile crest
#

tjbot and tjplay has one

compact holly
bright lark
sterile crest
#

for charts

compact holly
#

yeah, charting, not chatting or sharting

sterile crest
#

i heard lucid charts is good but i've never used it

bright lark
#

It's limited

compact holly
#

i read a study about mind maps, users have better long term recollection

sterile crest
#

do we need UML before we refactor the code?

bright lark
#

Drawio is life

compact holly
#

plantirUML maybe?

sterile crest
#

plantuml might work

#

cute .puml files

#

we haven't enabled discussions!!

bright lark
#

1st step: we define an overview about jshell.
2. We analyze potential actors
3. We analyze use cases

#

Im typically skilled in writing good doxs for uc

compact holly
#

do we need a market research?

#

and monetization strategy

bright lark
#

Wdym

sterile crest
timber mirage
bright lark
#

Pls gguyyys

#

No jokes

#

Im not joking

sterile crest
#

we're not joking, we just want to take it serious

bright lark
#

If im saying somthing unfeasible tell me

sterile crest
#

i think marko meant more like research on the technologies

sterile crest
#

wym by "We analyze potential actors" ?

#

this thing?

compact holly
timber mirage
bright lark
#

Ye based on information i have sf they are: user (abstract) and discord api

#

Or user, tjbot and discord

sterile crest
#

where does jshell come in?

bright lark
#

Jshel is the system

sterile crest
#

it's external to tj bot

#

tj bot is a consumer

#

jshell is a producer

bright lark
#

Actors are those who could interact with the system

compact holly
#

who do we sell this amazing product to?

sterile crest
#

lel

bright lark
compact holly
#

would be nice to earn some monies, and retire peepo_comfy

timber mirage
#

alright

#

guyes

compact holly
bright lark
#

It's an opensource solution

sterile crest
#

it needs refinement

bright lark
#

We could draw 2 or 3 diagrams

#

For key features or main ones

compact holly
#

I like diagrams

#

but what I like even more are sexy dashboards pogchamp

#

imagine just watching all the infra live, sitting in your room naked at 4am

bright lark
#

they help to see it in the big picture. also to help others

compact holly
#

just chiling, listening to some jazz

bright lark
#

Damn

compact holly
#

and watching all the containers move, like you are a drug smuggler

bright lark
#

Why u do this

compact holly
#

from dominican republic to congo to our vps peepo_happy

sterile crest
#

it should be this easy @timber mirage

compact holly
#

drinking some quality whiskey

compact holly
#

that's life

#

so I vote for sexy dashboards

sterile crest
#

entire solution is 87 lines

timber mirage
#

There is also this issue

compact holly
#

very specific

#

you could've just said simplify whole backend, and save yourself some time LUL

sterile crest
#

you can reference my code entirely to make it work

timber mirage
#

also @compact holly can you make functionnal tests ?

sterile crest
compact holly
#

any parts of it you specifically dislike, reasons why you dislike them?

timber mirage
#

if we rework stuff in the backend, we do need those tests

compact holly
#

strategies we can deploy to improve it?

timber mirage
compact holly
#

what particular issues does it have, why is it complex?

timber mirage
compact holly
#

the dockerservice class for example

timber mirage
#

docker service or closing ?

compact holly
#

do you have any ideas what could be done, strategies, refactoring methods?

timber mirage
compact holly
#

maybe some examples?

timber mirage
#

from what @sterile crest said

timber mirage
compact holly
#

in short, someone new coming to project, how should they approach it?

sterile crest
#

it just needs reduction in complexity

#

that's all

compact holly
#

just make it better peepo_happy

sterile crest
#

yeah

compact holly
#

that thing there? yeah

bright lark
#

Alr so first : reduce complexity. Then set getting started guide (damn why we dnt this like the one in tjbot wiki)

sterile crest
#

i can work on the docker side

compact holly
#

ye, firas you are in charge of the docs, and diagrams

#

feel free to improve them

bright lark
#

Im afraid they are priority as they help all of us

#

To see it

#

U understand what i mean

compact holly
#

yes, we can't stumble around blindfolded

#

we need some guiding light

#

that light would be you, firas peepo_happy

#

you are the chosen one

#

so feel free to write some docs peepo_comfy

sterile crest
#

i really feel like firas is going turn this project around, i can't wait peepo_happy

bright lark
#

The problm is dnt have laptop in the coming 4 days

sterile crest
#

we can wait for you firas

#

we need to wait for the new logs to gather anyway 🙂

bright lark
#

Im normal person

sterile crest
#

nobody is normal!

bright lark
#

I love Software dev thts all

sterile crest
#

you're exceptional

#

like your name! firas exception!

bright lark
sterile crest
#

oh you cannot compare mere mortals with gods, that wouldn't be fair

bright lark
#

Ah shit here we go again

sterile crest
#

we're leagues ahead of the rest but you're our messenger and the saving grace for the mere mortals that attempt to touch this jshell project

#

with your guidance and words, people will be able to understand the complexity a bit better

#

that's why the docs and diagrams are important

#

to preach the words of the elite to the uninformed

bright lark
#

The hard part is understanding the problem

sterile crest
#

we can even refer to the space as the "jshell bible"

#

because it contains all the teachings and information from the creators

#

you're an important piece to the puzzle

bright lark
#

peepo_cry i feel this is a joke

compact holly
#

matthew 15:14

sterile crest
#

we do need all of this stuff in place

bright lark
#

Cmon pls

#

Alright then

#

Agreed

#

I m gonna make some search on the ez ways to set good docs

sterile crest
bright lark
#

and meaningful diagrams

sterile crest
#

this is a tool i've been wanting to learn

#

and it's really great for documentation

compact holly
#

there is one doc tool written in rust!

sterile crest
#

the one i recommended at least has the word "java" in the name

bright lark
sterile crest
#

it's created by facebook

#

sorry "meta"

bright lark
#

We can have a whole static website for docs

sterile crest
#

yeah and host it using github pages

compact holly
#

it's created by.. facebook??

#

hell no

sterile crest
#

stfu

#

it's; open source

#

it's by meta

#

meta made react

#

and typescript(?)

bright lark
#

We could set introduction and guidelines in tab 1. Tab 2 can hold openapi docs for the jshel rest api with searchbar and table for fields

compact holly
#

we used mdbook for our java book peepo_happy

sterile crest
#

biggest tj fail yet

bright lark
compact holly
#

years ago

#

when we were still starting to build our empire

timber mirage
#

@bright lark what do you think ?

compact holly
#

I created this issue peepo_happy

bright lark
compact holly
#

i made quick comparison about different tools for creating docs

sterile crest
#

@compact holly i can't man

timber mirage
sterile crest
#

i'm dying

compact holly
#

your docusaurus is not even on my list

bright lark
compact holly
#

probably some new bs

sterile crest
#

use plantuml ala

compact holly
#

so besides this

#

I also wrote automatic UML generation on TJ

timber mirage
bright lark
compact holly
#

using plantUML doclet

bright lark
#

What is that?

timber mirage
compact holly
#

generating UML disagrams from java code

bright lark
#

Waait guys

sterile crest
#

i did this by hand

bright lark
#

Please wait

compact holly
#

automatically, and embedding them in javadocs html files

bright lark
#

There is a very useful tool i know

compact holly
#

the only issue at that time was, that we didn't have any javadocs

#

so my uml implementation was a bit early

#

or well, our javadocs weren't published online

#

so having UML diagrams weren't that useful

timber mirage
#

@bright lark like this?

sterile crest
compact holly
#

hooly, here we go pogchamp

sterile crest
#

i deleted it was work stuff :3 sorry marko

compact holly
compact holly
bright lark
#

Now the arrow on the left

compact holly
#

bro used that bucket fill tool in paint LUL

bright lark
#

Use drawio

#

It gives lots of options

sterile crest
#

you need to use a proper sequence diagram not this mspaint shit man

compact holly
#

I also can only read crow's foot anotation

bright lark
#

And put actors (those who interact with it outside

#

The arrows must come from somthing to the system and from system to somthing

compact holly
bright lark
#

It doesnt make to come from void

compact holly
#

Crow's foot notation, the beginning of which dates back to an article by Gordon Everest (1976),[16] is used in Barker's notation, Structured Systems Analysis and Design Method (SSADM), and information technology engineering. Crow's foot diagrams represent entities as boxes, and relationships as lines between the boxes. Different shapes at the ends of these lines represent the relative cardinality of the relationship.

bright lark
compact holly
#

chen is considered for losers

#

that are uneducated and illiterate, so they can't read superior crow's foot notation

sterile crest
#

even an activity diagram is better

timber mirage
#

@bright lark alright

sterile crest
#

so like firstbox is discord > tj > jshell > internals