Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#41): latex.rs, puzzles #47

Merged
merged 11 commits into from
Jun 26, 2024
Merged

feat(#41): latex.rs, puzzles #47

merged 11 commits into from
Jun 26, 2024

Conversation

h1alexbel
Copy link
Owner

@h1alexbel h1alexbel commented Jun 24, 2024

@l3r8yJ take a look, please
closes #41


PR-Codex overview

This PR adds a new report module with latex.rs for generating reports in LaTeX format. It also includes a function to read a LaTeX template file and a test for template content comparison.

Detailed summary

  • Added report module with latex.rs for report generation
  • Implemented function to read LaTeX template file
  • Added a test for comparing template content

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.82%. Comparing base (f8bde4e) to head (fac468e).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   53.33%   58.82%   +5.49%     
==========================================
  Files           4        5       +1     
  Lines          15       17       +2     
==========================================
+ Hits            8       10       +2     
  Misses          7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@h1alexbel h1alexbel requested a review from l3r8yJ June 24, 2024 09:30
Copy link
Collaborator

@l3r8yJ l3r8yJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h1alexbel take a look at my comments below, please. Also I'm not sure that this PR is closing the tickets, should be use ref in description instead of closing or refactor PR to fully close the issue, wdyt?

/// ```
pub fn template(path: Option<&str>) -> String {
return fs::read_to_string(Path::new(path.unwrap_or("resources/report.tex")))
.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h1alexbel it's not the best practice to use #unwrap, my suggestion is to setup clippy to exclude usage of #unwrap

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l3r8yJ Should I use match instead?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h1alexbel sure

@h1alexbel
Copy link
Owner Author

h1alexbel commented Jun 24, 2024

@h1alexbel take a look at my comments below, please. Also I'm not sure that this PR is closing the tickets, should be use ref in description instead of closing or refactor PR to fully close the issue, wdyt?

@l3r8yJ Let me explain then. #41 is quite abstract and we had a conversation in it about additional flags and so on. I decided to "kick off" this ticket here, and decompose future work into more manageable and easy-to-go tickets. That's why I committed a few related puzzles as well. WDYT?

@h1alexbel
Copy link
Owner Author

need to adjust puzzles according to this comment: #41 (comment)

@l3r8yJ
Copy link
Collaborator

l3r8yJ commented Jun 24, 2024

@h1alexbel can you refactor puzzles and request again?

@h1alexbel
Copy link
Owner Author

@l3r8yJ yes

@h1alexbel h1alexbel requested a review from l3r8yJ June 24, 2024 17:54
@h1alexbel h1alexbel removed the request for review from l3r8yJ June 24, 2024 18:00
@h1alexbel
Copy link
Owner Author

@l3r8yJ the branch is ready

@h1alexbel h1alexbel requested a review from l3r8yJ June 24, 2024 18:01
Copy link
Collaborator

@l3r8yJ l3r8yJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h1alexbel take a look at my comments below, please

/// let content = template(None);
/// print!("{content}")
/// ```
pub fn template(path: Option<&str>) -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h1alexbel i think in this case path should be required, you can add it to Args and set default value if nothing was provided to --report argument; txt would be fine for default value

Copy link
Owner Author

@h1alexbel h1alexbel Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l3r8yJ yes, this function will be called only if cli parser will find non-empty --report option.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h1alexbel can you add the puzzle or implementation?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l3r8yJ it's already added as puzzle in cli/src/args.rs

server/src/report/latex.rs Outdated Show resolved Hide resolved
@h1alexbel h1alexbel requested a review from l3r8yJ June 25, 2024 16:57
Copy link
Collaborator

@l3r8yJ l3r8yJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h1alexbel looks good to me!

Copy link

@l3r8yJ

Excellent review

Analyzed with Phind/Phind-CodeLlama-34B-v2

@h1alexbel
Copy link
Owner Author

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor merge

@h1alexbel Can't merge it. Some CI checks were failed. Apparently, the pull request is not ready to be merged since it has some problems. Please, fix them first.

@h1alexbel
Copy link
Owner Author

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor merge

@h1alexbel Can't merge it. Some CI checks were failed. Apparently, the pull request is not ready to be merged since it has some problems. Please, fix them first.

@h1alexbel
Copy link
Owner Author

@rultor status

@h1alexbel
Copy link
Owner Author

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor status

@h1alexbel This is what's going on here:

  • no new requests registered
  • build is not running

More information about Rultor commands you can get here.

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor merge

@h1alexbel Can't merge it. Some CI checks were failed. Apparently, the pull request is not ready to be merged since it has some problems. Please, fix them first.

@h1alexbel
Copy link
Owner Author

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor merge

@h1alexbel Can't merge it. Some CI checks were failed. Apparently, the pull request is not ready to be merged since it has some problems. Please, fix them first.

@h1alexbel
Copy link
Owner Author

@rultor stop

@h1alexbel
Copy link
Owner Author

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor stop

@h1alexbel OK, I'll try to stop current task.

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor merge

@h1alexbel Can't merge it. Some CI checks were failed. Apparently, the pull request is not ready to be merged since it has some problems. Please, fix them first.

@rultor
Copy link
Collaborator

rultor commented Jun 26, 2024

@rultor stop

@h1alexbel Sorry, I failed to stop the previous command, however it has the following result: Oops, I failed. You can see the full log here (spent 14s)

+ set -e
+ set -o pipefail
++ dirname ./run.sh
+ cd .
+ echo 1476
+ echo '2.0-SNAPSHOT BUILD'
2.0-SNAPSHOT BUILD
+ date
Wed Jun 26 10:31:00 UTC 2024
+ uptime
 10:31:00 up 0 min,  0 users,  load average: 1.83, 0.47, 0.16
+ cat
com.rultor.spi.Profile: There is no 'stop' section in .rultor.yml for branch master in repo h1alexbel/fakehub
	at com.rultor.agents.req.StartsRequest.docker(StartsRequest.java:353)
	at com.rultor.agents.req.StartsRequest.vars(StartsRequest.java:258)
	at com.rultor.agents.req.StartsRequest.script(StartsRequest.java:147)
	at com.rultor.agents.req.StartsRequest.process(StartsRequest.java:108)
	at com.rultor.agents.AbstractAgent.execute(AbstractAgent.java:73)
	at com.rultor.spi.Agent.execute(Agent.java:89)
	at com.rultor.agents.VerboseAgent.execute(VerboseAgent.java:60)
	at com.rultor.Routine.process(Routine.java:203)
	at com.rultor.Routine.unsafe_aroundBody0(Routine.java:180)
	at com.rultor.Routine.run(Routine.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:164)
	at com.jcabi.aspects.aj.MethodInterrupter.wrap(MethodInterrupter.java:109)
	at com.rultor.Routine.unsafe(Routine.java:175)
	at com.rultor.Routine.run(Routine.java:140)
	at com.jcabi.log.VerboseRunnable.run(VerboseRunnable.java:190)
	at com.jcabi.aspects.aj.MethodScheduler.lambda./run.sh(MethodScheduler.java:194)
	at java.base/java.util.concurrent.Executors.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor.run(ThreadPoolExecutor.java:635)
	at com.jcabi.log.VerboseThreads.run(VerboseThreads.java:222)
	at java.base/java.lang.Thread.run(Thread.java:833)

+ exit -1
'cid' file is absent, Docker container is not running
'cid' file is absent, most probably the Docker container wasn't started correctly

@h1alexbel h1alexbel merged commit fe9cf78 into master Jun 26, 2024
19 checks passed
@h1alexbel h1alexbel deleted the 41 branch June 26, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate report.tex with all interaction history with fakehub
3 participants