Helping out with server development

I made some good progress today. I figured out enough about how the permissions work to be able to edit a text. I also created my own entry in translation/en/ to play around with publishing a text. So now I have translation/en/dayunbao/test with a file in it. Something isn’t quite right with it, but I was able to I publish it. Doing that created a PR in the main (your) repo. I closed that and deleted the branch, though.

3 Likes

That’s awesome, congrats.

1 Like

I’ve been playing around with the existing GitHub Action, the one that pushes published changes to sc-data. I ran into a permission issue, but I don’t really need to get that working in my repo. I’ve started looking at the GitHub Action you wanted me to set up. I took yesterday and tonight off, though, since my eyes were getting burned out after programming at work all day then working on SuttaCentral code.

After a quick glance, it seems that the GitHub Action you want me to set up is already mostly done, but I’m guessing there’s a problem with it?

1 Like

Well that’s really good progress.

What happened was that last year we got this working with our Polish friends at STXnext. All the scripts and everything work great, and as you see, they set up ready for Github Actions. Then we ran out of time, and intended to do the final implementation ourselves. And as you can see, that never happened.

So is it mostly done? Yes! But we haven’t actually set it up or tested it. So that’s what we need to do. Hopefully it won’t be too complicated.

1 Like

OK. Well, I hope I’m not jinxing myself by saying it, but I think it won’t be too complicated. I’ll definitely try to get it set up this weekend, if not before.

2 Likes

I spent this weekend looking at that GitHub Action, which naturally led me to the sc-renumber-segments repo and the sutta-processor program. I think I’m starting to get an idea of how the sutta-processor program works. I have a few questions, though, mostly about the class naming conventions.

There are a few classes with the word “Versus” in the name, like BaseVersus. Was that meant to be BaseVerses? All the classes with that in the name seem to be related to a Verse, so that’s what I’m thinking that. I’m trying to better understand the purpose of those classes, and the name is throwing me off.

I’m also wondering about the use of the word “aggregate.” There are several classes with “Aggregate” in the name. Does that just refer to files?

1 Like

Lol yes, our Polish friend misspelled it, it would be good to correct it!

I’m not sure about this one.


Oh, and BTW if you’re a fan of Python and Monty Python you’ll like this!

https://twitter.com/prdoyle/status/1355934460773085193

OK. Do you want me to fix that and create a PR?

sure, please that would be good.

1 Like

I created the PR last night. Not sure if GitHub notified you.

1 Like

Ahh, I can’t see it, can you give me a URL?

Okay, so I haven’t run this since we first did it and I’m kind of rusty.

I set up the repo freshly following the instructions there. It seems to work okay. But when i run run_all_checks I get an error.

I seem to remember I used to have to manually copy bilara-data into the repo. Is that right? Or how does it work?

Loading config: 'example_config.yaml'
* [BilaraRootAggregate] Processed: '0' files. good: '0', bad: '0'. Failed ratio: 0.00%
* [BilaraRootAggregate] Loaded '0' UIDs
* [BilaraCommentAggregate] Processed: '0' files. good: '0', bad: '0'. Failed ratio: 0.00%
* [BilaraCommentAggregate] Loaded '0' UIDs
* [BilaraHtmlAggregate] Processed: '0' files. good: '0', bad: '0'. Failed ratio: 0.00%
* [BilaraHtmlAggregate] Loaded '0' UIDs
* [BilaraReferenceAggregate] Processed: '0' files. good: '0', bad: '0'. Failed ratio: 0.00%
* [BilaraReferenceAggregate] Loaded '0' UIDs
1
Traceback (most recent call last):
  File "/home/sujato/sc-renumber-segments/src/sutta_processor/run_app.py", line 28, in run
    sys.exit(main())
  File "/home/sujato/sc-renumber-segments/src/sutta_processor/run_app.py", line 22, in main
    exec_module(cfg=cfg)
  File "/home/sujato/sc-renumber-segments/src/sutta_processor/application/use_cases/run_all_checks.py", line 24, in run_all_checks
    bilara_check_references(cfg=cfg)
  File "/home/sujato/sc-renumber-segments/src/sutta_processor/application/use_cases/bilara_check_references.py", line 16, in bilara_check_references
    cfg.check.reference.get_duplicated_ms_id(reference=reference)
  File "/home/sujato/sc-renumber-segments/src/sutta_processor/application/check_service/bd_reference.py", line 172, in get_duplicated_ms_id
    duplicated_ms_id = get_surplus_ref(c=counter)
  File "/home/sujato/sc-renumber-segments/src/sutta_processor/application/check_service/bd_reference.py", line 168, in get_surplus_ref
    duplicates.pop(1)
KeyError: 1

Yes, Bhante, you need a copy of the bilara-data repo inside the sc-renumber-segments repo.

okay, thanks, I feel like that should be in the README. Anyway, let me see …

Just to clarify, at the top level of the repo, right?

Yes. This is where I put it /home/hideaki/Code/sc-renumber-segments/bilara-data

Okay then, so I’ve set everything up again and have copied in bilara-data, still getting the same error message.

Oh, and FYI I’m running the master branch, I wanted to make sure that’s working before checking the new one.

Hmm, I’m checking my set up to see if there’s anything else I did that wasn’t in the README.

I wonder if there’s a problem with the Python virtual environment?

I’m not sure why it isn’t working for you. I diffed the example_config.yaml, comparing the original (found in /sc-renumber-segments/src/example_config.yaml) and the one I copied into the top level directory (/sc-renumber-segments/example_config.yaml) and the only thing I changed was the exec_module. Did you rename the bilara-data repo when you cloned it? If you look in example_config.yaml you can see the paths the script uses to find the bilara-data repo.