Piotr Skorupa activity https://gitlab.com/pskorupa 2026-03-19T04:44:02Z tag:gitlab.com,2026-03-19:5220383845 Piotr Skorupa deleted project branch push-prkpknzmzyop at GitLab.org / GitLab 2026-03-19T04:44:02Z pskorupa Piotr Skorupa

Piotr Skorupa (2d734ae6) at 19 Mar 04:44

tag:gitlab.com,2026-03-19:5220383091 Piotr Skorupa pushed to project branch master at GitLab.org / GitLab 2026-03-19T04:43:30Z pskorupa Piotr Skorupa

Piotr Skorupa (e1a7e1e0) at 19 Mar 04:43

Merge branch 'push-prkpknzmzyop' into 'master'

... and 1 more commit

tag:gitlab.com,2026-03-19:5220381738 Piotr Skorupa accepted merge request !224626: Treat `<iframe>` as `<img>` at GitLab.org / GitLab 2026-03-19T04:42:37Z pskorupa Piotr Skorupa

What does this MR do and why?

Per #282443 ("What Could Still Be Implemented"), let's allow users to drop embed iframe code directly into Markdown source.

This isn't a controversial ask, and it was highly requested. I kept it out of the MVC to keep things simple.

Right now, if you want to embed a YouTube video, for example, you have to:

  1. Go to your YouTube video. (OK.)
  2. Click the "Share" button. (Seems fair.)
  3. Click "Embed". (Right.)
  4. Copy the embed code you're given. (OK!)
    <iframe width="560" height="315" src="https://www.youtube.com/embed/DwIepRJgMF4"
    title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write;
    encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  5. Paste it into a Markdown field on GitLab. (Naturally.)
  6. Edit it to remove everything but the URL in the src attribute. (Huh?)
  7. Add ![]( before that URL, and ) after it. (????)
  8. Done! (😥)

Now, steps 1 to 4 could themselves be improved upon (and will in the next stacked MR!), but in this one we're focussing on (read: removing) steps 6 and 7.

A previous draft of the whole iframe feature actually permitted <iframe>s through in the SanitizationFilter, and then filtered them based on the allowlist. This doesn't work primarily because the allowlist might change. For this reason, we don't ever currently store an <iframe> in cached rendered HTML; we just tag would-be iframes with js-render-iframe, and then the frontend references the allowlist (again!) before transforming that into a live <iframe>.

It's also just better never to store a live <iframe> in the database column; sometimes they're exposed without being processed by the correct frontend code (recent example: !227421), and having the natural outcome of such an exposure be "an inert <div> is put on the page" is much better than something with security ramifications.

So, this MR takes the same approach and applies it to actually pasted <iframe>s: if the iframe embedding feature is enabled in the settings, we scan the document before sanitisation and change any <iframe>s into <img>s. They become harmless <img> tags which pass the sanitisation filter.

These <img>s will then be picked up by the IframeLinkFilter the same way the equivalent embed would be (i.e. it looks identical to someone who followed steps 1 to 8 above), tagged appropriately and then rendered into an <iframe> on the frontend after passing the allowlist again.

This approach is pretty nice: we don't have to touch the sanitiser, and we don't need separate codepaths for folks using the GitLab native embed syntax ![]() and those just copy-pasting their embeds and wanting it to work.

The one oddity is that non-allowlisted iframes will end up being treated as images! But I think this is an OK and pretty normal consequence: it's the exact same outcome as writing ![](https://my-non-allowlisted-iframe.com). This is a win — the syntaxes are treated identically because they actually become the same thing early on, and so we don't need separate sanitisation or rendering codepaths on the backend or frontend. If the feature is disabled (or an <iframe> not passing the allowlist is seen at the backend stage), it's sanitised out very early on as usual.

References

Past work:

  • !204952 was the preliminary work for potential iframe recognition
  • !200864 carried the initial implementation
  • !215529 fixed two bugs that stopped it from being usable on GitLab.com; since this MR the feature is configured and usable on GitLab.com, but you need to enable the FF for your group (we have it enabled in groupknowledge)

Present work: a series of 4 stacked MRs for %18.10/%18.11 to bring this closer to GA:

How to set up and validate locally

  1. Check out the branch.

  2. Enable the allow_iframes_in_markdown feature on your GDK.

  3. Enable embedding of www.youtube.com from /admin/application_settings/general#js-iframe-settings, and ensure Enable embedded content is turned on.

  4. It may be wise to restart the GDK Rails instance here, for best chances of success.

  5. Using the plain-text editor, insert the following content into a wiki page, issue description, MR comment, etc.:

    <iframe width="560" height="315" src="proxy.php?url=https://www.youtube.com/embed/DwIepRJgMF4"
    title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write;
    encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  6. It should embed correctly, at a decent size (560x315 per the tag).

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

tag:gitlab.com,2026-03-18:5219607728 Piotr Skorupa pushed to project branch master at GitLab.org / GitLab 2026-03-18T21:50:04Z pskorupa Piotr Skorupa

Piotr Skorupa (a91ed7b4) at 18 Mar 21:50

Merge branch 'ngala/update-pages-version-18-Mar' into 'master'

... and 1 more commit

tag:gitlab.com,2026-03-18:5219607144 Piotr Skorupa deleted project branch ngala/update-pages-version-18-Mar at GitLab.org / GitLab 2026-03-18T21:49:44Z pskorupa Piotr Skorupa

Piotr Skorupa (14b39aeb) at 18 Mar 21:49

tag:gitlab.com,2026-03-18:5219606184 Piotr Skorupa accepted merge request !227861: Update GitLab Pages version at GitLab.org / GitLab 2026-03-18T21:49:14Z pskorupa Piotr Skorupa

What does this MR do and why?

Update GitLab Pages version

[email protected]

This is part of the Gitlab Pages update process

Changelog: other

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

tag:gitlab.com,2026-03-18:5219606056 Piotr Skorupa commented on merge request !227861 at GitLab.org / GitLab 2026-03-18T21:49:10Z pskorupa Piotr Skorupa

Done!

tag:gitlab.com,2026-03-18:5217041177 Piotr Skorupa commented on merge request !224626 at GitLab.org / GitLab 2026-03-18T11:25:30Z pskorupa Piotr Skorupa

@kivikakk Thank you for a very informative and exhaustive description! This made understanding the change extremely easy for me. LGTM 🚢

tag:gitlab.com,2026-03-18:5217039722 Piotr Skorupa approved merge request !224626: Treat `&lt;iframe&gt;` as `&lt;img&gt;` at GitLab.org / GitLab 2026-03-18T11:25:12Z pskorupa Piotr Skorupa

What does this MR do and why?

Per #282443 ("What Could Still Be Implemented"), let's allow users to drop embed iframe code directly into Markdown source.

This isn't a controversial ask, and it was highly requested. I kept it out of the MVC to keep things simple.

Right now, if you want to embed a YouTube video, for example, you have to:

  1. Go to your YouTube video. (OK.)
  2. Click the "Share" button. (Seems fair.)
  3. Click "Embed". (Right.)
  4. Copy the embed code you're given. (OK!)
    <iframe width="560" height="315" src="https://www.youtube.com/embed/DwIepRJgMF4"
    title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write;
    encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  5. Paste it into a Markdown field on GitLab. (Naturally.)
  6. Edit it to remove everything but the URL in the src attribute. (Huh?)
  7. Add ![]( before that URL, and ) after it. (????)
  8. Done! (😥)

Now, steps 1 to 4 could themselves be improved upon (and will in the next stacked MR!), but in this one we're focussing on (read: removing) steps 6 and 7.

A previous draft of the whole iframe feature actually permitted <iframe>s through in the SanitizationFilter, and then filtered them based on the allowlist. This doesn't work primarily because the allowlist might change. For this reason, we don't ever currently store an <iframe> in cached rendered HTML; we just tag would-be iframes with js-render-iframe, and then the frontend references the allowlist (again!) before transforming that into a live <iframe>.

It's also just better never to store a live <iframe> in the database column; sometimes they're exposed without being processed by the correct frontend code (recent example: !227421), and having the natural outcome of such an exposure be "an inert <div> is put on the page" is much better than something with security ramifications.

So, this MR takes the same approach and applies it to actually pasted <iframe>s: if the iframe embedding feature is enabled in the settings, we scan the document before sanitisation and change any <iframe>s into <img>s. They become harmless <img> tags which pass the sanitisation filter.

These <img>s will then be picked up by the IframeLinkFilter the same way the equivalent embed would be (i.e. it looks identical to someone who followed steps 1 to 8 above), tagged appropriately and then rendered into an <iframe> on the frontend after passing the allowlist again.

This approach is pretty nice: we don't have to touch the sanitiser, and we don't need separate codepaths for folks using the GitLab native embed syntax ![]() and those just copy-pasting their embeds and wanting it to work.

The one oddity is that non-allowlisted iframes will end up being treated as images! But I think this is an OK and pretty normal consequence: it's the exact same outcome as writing ![](https://my-non-allowlisted-iframe.com). This is a win — the syntaxes are treated identically because they actually become the same thing early on, and so we don't need separate sanitisation or rendering codepaths on the backend or frontend. If the feature is disabled (or an <iframe> not passing the allowlist is seen at the backend stage), it's sanitised out very early on as usual.

References

Past work:

  • !204952 was the preliminary work for potential iframe recognition
  • !200864 carried the initial implementation
  • !215529 fixed two bugs that stopped it from being usable on GitLab.com; since this MR the feature is configured and usable on GitLab.com, but you need to enable the FF for your group (we have it enabled in groupknowledge)

Present work: a series of 4 stacked MRs for %18.10/%18.11 to bring this closer to GA:

How to set up and validate locally

  1. Check out the branch.

  2. Enable the allow_iframes_in_markdown feature on your GDK.

  3. Enable embedding of www.youtube.com from /admin/application_settings/general#js-iframe-settings, and ensure Enable embedded content is turned on.

  4. It may be wise to restart the GDK Rails instance here, for best chances of success.

  5. Using the plain-text editor, insert the following content into a wiki page, issue description, MR comment, etc.:

    <iframe width="560" height="315" src="proxy.php?url=https://www.youtube.com/embed/DwIepRJgMF4"
    title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write;
    encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  6. It should embed correctly, at a decent size (560x315 per the tag).

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

tag:gitlab.com,2026-03-18:5216902848 Piotr Skorupa commented on merge request !227861 at GitLab.org / GitLab 2026-03-18T10:54:01Z pskorupa Piotr Skorupa

@ngala Thanks, LGTM

tag:gitlab.com,2026-03-18:5216901752 Piotr Skorupa approved merge request !227861: Update GitLab Pages version at GitLab.org / GitLab 2026-03-18T10:53:47Z pskorupa Piotr Skorupa

What does this MR do and why?

Update GitLab Pages version

[email protected]

This is part of the Gitlab Pages update process

Changelog: other

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

tag:gitlab.com,2026-03-17:5214820662 Piotr Skorupa closed issue #588110: Update models with identical policies to use `declarative_policy_class` at GitLab.org / GitLab 2026-03-17T21:30:11Z pskorupa Piotr Skorupa tag:gitlab.com,2026-03-16:5210292376 Piotr Skorupa opened merge request !227566: Refactor virtual registry policy specs at GitLab.org / GitLab 2026-03-16T22:36:40Z pskorupa Piotr Skorupa

What does this MR do and why?

This does some post-merge fixes to virtual registries policy specs, based on !225625.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

tag:gitlab.com,2026-03-16:5210286885 Piotr Skorupa pushed new project branch psk-more-registry-policies-refactoring-fixes at GitLab.org / GitLab 2026-03-16T22:33:29Z pskorupa Piotr Skorupa

Piotr Skorupa (c31719a9) at 16 Mar 22:33

Remove redundant spec group factory call

... and 7 more commits

tag:gitlab.com,2026-03-13:5202483244 Piotr Skorupa commented on issue #505781 at GitLab.org / GitLab 2026-03-13T18:00:33Z pskorupa Piotr Skorupa

All merged; closing

tag:gitlab.com,2026-03-13:5202481839 Piotr Skorupa closed issue #505781: npm: track packages deprecation at GitLab.org / GitLab 2026-03-13T18:00:13Z pskorupa Piotr Skorupa tag:gitlab.com,2026-03-13:5202480216 Piotr Skorupa commented on merge request !225625 at GitLab.org / GitLab 2026-03-13T17:59:40Z pskorupa Piotr Skorupa

@alexbuijs Ah, sorry, I got confused by the naming. I didn't rebase in a while and these files were added in the meantime. Removed ee/app/policies/virtual_registries/packages/maven/upstream/rule_policy.rb as well.

tag:gitlab.com,2026-03-13:5202476916 Piotr Skorupa pushed to project branch 588110-update-models-with-identical-policies-to-use-declarative_policy_class at GitLab.org / GitLab 2026-03-13T17:58:37Z pskorupa Piotr Skorupa

Piotr Skorupa (df4eccbf) at 13 Mar 17:58

Remove redundant Maven::Upstream::RulePolicy

... and 2780 more commits

tag:gitlab.com,2026-03-13:5200943429 Piotr Skorupa commented on merge request !225625 at GitLab.org / GitLab 2026-03-13T11:32:25Z pskorupa Piotr Skorupa

There's also a failing spec example for one of these registry upstream models, but it's a flaky test and not actually related.

tag:gitlab.com,2026-03-13:5200937338 Piotr Skorupa pushed to project branch master at GitLab.org / GitLab 2026-03-13T11:30:47Z pskorupa Piotr Skorupa

Piotr Skorupa (9845b77a) at 13 Mar 11:30

Merge branch '587651-update-up' into 'master'

... and 1 more commit