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

Removing multiple completely yields runtime error #158

Closed
g-pavlov opened this issue Feb 5, 2021 · 0 comments · Fixed by #159
Closed

Removing multiple completely yields runtime error #158

g-pavlov opened this issue Feb 5, 2021 · 0 comments · Fixed by #159
Assignees
Labels
kind/bug Bug priority/2 Priority (lower number equals higher priority)

Comments

@g-pavlov
Copy link
Contributor

g-pavlov commented Feb 5, 2021

What happened:
Removing multiple links completely with a rewrite rule fails with runtime error.

panic: runtime error: slice bounds out of range [:104] with capacity 64

goroutine 54 [running]:
github.com/gardener/docforge/pkg/markdown/parser.(*link).GetDestination(0xc0004180c0, 0xc0004101b7, 0x1, 0x9)
        /home/i024136/dev/docforge/pkg/markdown/parser/links.go:115 +0x8b
github.com/gardener/docforge/pkg/markdown.UpdateMarkdownLinks.func1(0xc1b180, 0xc0004180c0)
        /home/i024136/dev/docforge/pkg/markdown/links.go:79 +0xbd
github.com/gardener/docforge/pkg/markdown/parser.(*document).ListLinks(0xc000400060, 0xc00040c030)
        /home/i024136/dev/docforge/pkg/markdown/parser/document.go:15 +0x82
github.com/gardener/docforge/pkg/markdown.UpdateMarkdownLinks(0xc00040a000, 0xa9, 0x2a9, 0xc000418000, 0x0, 0xc00040a000, 0xa9, 0x2a9, 0x41)
        /home/i024136/dev/docforge/pkg/markdown/links.go:67 +0xc4
github.com/gardener/docforge/pkg/reactor.(*nodeContentProcessor).reconcileMDLinks(0xc0000bf380, 0xc15700, 0xc0000cb640, 0xc0001be3f0, 0xc00040a000, 0xa9, 0x2a9, 0xc0000a8150, 0x24, 0x0, ...)
        /home/i024136/dev/docforge/pkg/reactor/content_processor.go:104 +0xe9
github.com/gardener/docforge/pkg/reactor.(*nodeContentProcessor).ReconcileLinks(0xc0000bf380, 0xc15700, 0xc0000cb640, 0xc0001be3f0, 0xc0000a8150, 0x24, 0xc00040a000, 0xa9, 0x2a9, 0x0, ...)
        /home/i024136/dev/docforge/pkg/reactor/content_processor.go:87 +0x1cd
github.com/gardener/docforge/pkg/reactor.(*DocumentWorker).Work(0xc0001771f0, 0xc15700, 0xc0000cb640, 0xa23ce0, 0xc0000bc348, 0xc15940, 0xc0001731a0, 0x2)
        /home/i024136/dev/docforge/pkg/reactor/document_worker.go:142 +0x8ee
github.com/gardener/docforge/pkg/jobs.(*Job).startWorkers.func1(0xc00017d220, 0xc000304000, 0xc15700, 0xc0000cb640, 0x4, 0xc15940, 0xc0001731a0, 0xc000302000)
        /home/i024136/dev/docforge/pkg/jobs/jobs.go:248 +0x302
created by github.com/gardener/docforge/pkg/jobs.(*Job).startWorkers
        /home/i024136/dev/docforge/pkg/jobs/jobs.go:232 +0x115

What you expected to happen:
Links to be removed

How to reproduce it (as minimally and precisely as possible):

  • manifest:
structure:
- source: /home/user/test/links.md
links:
  rewrites:
    (pulls|pull|issues|issue|wiki): ~
  • markdown ( /home/user/test/links.md) with multiple links that match rewrite rule that removes them:
[a](https://github.com/gardener/documentation/wiki/Architecture)
[b](https://github.com/gardener/gardener/issues/356)
[c](https://github.com/gardener/gardener/pull/2309)

How to categorize this issue?
/kind bug
/priority critical

@g-pavlov g-pavlov added the kind/bug Bug label Feb 5, 2021
@g-pavlov g-pavlov self-assigned this Feb 5, 2021
@gardener-robot gardener-robot added the priority/critical Needs to be resolved soon, because it impacts users negatively label Feb 5, 2021
@gardener-robot gardener-robot added priority/2 Priority (lower number equals higher priority) and removed priority/critical Needs to be resolved soon, because it impacts users negatively labels Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug priority/2 Priority (lower number equals higher priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants