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
Use save_file for external repositories #1763
base: staging
Are you sure you want to change the base?
Use save_file for external repositories #1763
Conversation
I suggest to rebase on staging (#1761 is merged) and then refactor the specs such that |
177f7df
to
c7a91f9
Compare
I added the |
I don't know if we should fix it in this branch or treat it as a new issue: The ontology that is put into the external repository gets a URL or Loc/Id that does not allow to inspect the ontology itself. Instead, the file view is shown. How to test: Try to upload https://raw.githubusercontent.com/eugenk/test-import-dol/master/Importer1.dol and then check the ontology that is put into the repository "External" Edit: Parsing this ontology also fails with
so this should be handled in this PR. |
Another issue: The ontology in the external repository has two versions right from the beginning. This is probably because we use both |
I can't seem to reproduce either of those bugs locally on my machine. The ontologies get the locids |
Weird: I just retried the whole process and now I get a blank page when I want to access the ontology in the external repository. The log says that the URL is routed to ontologies#show. |
When I upload https://raw.githubusercontent.com/eugenk/test-import-dol/master/Importer1.dol to the repository "default" [4] pry(main)> Repository.find_by_path('external').ontologies.first.versions.count
=> 2
[5] pry(main)> Repository.find_by_path('external').ontologies.select(%i(name basepath
=> [#<Ontology name: "Owlbase", basepath: "github.com/eugenk/test-import-dol/raw/master/OwlBas...", file_extension: ".owl">]
[7] pry(main)> Repository.find_by_path('external').ontologies.first.locid
=> "/external/github.com/eugenk/test-import-dol/raw/master/OwlBase.owl" |
When I visit this Loc/Id (http://localhost:3000/external/github.com/eugenk/test-import-dol/raw/master/OwlBase.owl), I see to the file view instead of the ontology view. Edit: No, this time I get a 406 (Not acceptable) code |
The locid is generated this way because the node in the dgraph has the name |
@tillmo, what's best to do here? The ontology already has a different URL than the original one because it's hosted on ontohub. So, I think it's safe to use a name and a Loc/Id without the file extension for the imported ontology. |
…ead and cannot be read again in chunks.
bbfb417
to
59611bb
Compare
More problems:
This results in a locid like
instead of just
I could do something similar to For comparison, what hets normally returns:
|
for now, this might be a solution. However, the deeper problem is a Hets problem, see spechub/Hets#1596 |
The problem does not seem to be the the locid itself, but rather the router. I created a new ticket here: #1790. |
This fixes #1535. Until #1761 is merged, it also exhibits the bug from #1753.
I'm not sure if I can delete
save_file_only
completely from the code, or if it is needed for the tests (which is the only place it is still used).