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

Encoding problems #11

Closed
Rustamer opened this issue Jun 7, 2019 · 9 comments
Closed

Encoding problems #11

Rustamer opened this issue Jun 7, 2019 · 9 comments
Assignees

Comments

@Rustamer
Copy link

Rustamer commented Jun 7, 2019

There are problems with the encoding. When transmitting Cyrillic names get question marks in MS Teams in the fields Triggered by the description of the changes. There are no such problems in TeamCIty itself.
P.S. Mercurial is used as a version control system.

@Rustamer
Copy link
Author

Rustamer commented Jun 7, 2019

screenshot 2019-06-07 001

@spyder007
Copy link
Owner

The implementation pulls data from the SBuild class and stores those values in a temporary class. That class is then serialized using the com.google.gson.

There is no explicit encoding/decoding done in the plugin, so it's possible that the is an encoding/decoding issue in either the JetBrains Teamcity libraries OR the GSON libraries. It's also possible that the MS Teams webhook doesn't like the characters being sent.

If you set your log level to INFO, there should be a server log with the following prefix:
MsTeamsNotificationListener :: Body message will be

followed by the entirety of the JSON message that is sent to the Teams Incoming Webhook. Would you be able to check your Teamcity Server logs for that message and determine if the Cyrillic characters are correct in that message? if they are not, it's probably one of the libraries above. if they ARE, then it's an issue with the HTTP post to MS Teams.

On the side, i'm working on updating the Jetbrains and GSON libraries to their latest versions (updating to Teamcity 2019.1). If we determine it's a library issue, I can release version 2.0 with the latest Teamcity versions for you.

@anivaros
Copy link

anivaros commented Jul 2, 2019

Checked my server, in log all OK:

[2019-07-02 17:58:06,679]   INFO -   jetbrains.buildServer.SERVER - MsTeamsNotificationListener :: Body message will be 
{
    "@context": "http://schema.org/extensions",
    "@type": "MessageCard",
    "sections": [
        {
            "activityImage": "https://raw.githubusercontent.com/spyder007/teamcity-msteams-notifier/master/docs/TeamCity72x72.png",
            "activityTitle": "ExecutiveWorkspace",
            "facts": [
                {
                    "name": "Branch",
                    "value": "releases/release-4.8.0"
                },
                {
                    "name": "Triggered by",
                    "value": "Anisimov Vasiliy"
                },
                {
                    "name": "Agent",
                    "value": "ordo-ios-build-agent"
                },
                {
                    "name": "Elapsed",
                    "value": "5m:33s"
                }
            ],
            "startGroup": false
        },
        {
            "facts": [
                {
                    "name": "bfefeb23ee",
                    "value": "anisimov.v :: Включил локальные уведомления о новых документах для СОГАЗа\n"
                },
                {
                    "name": "633e3b3625",
                    "value": "anisimov.v :: Фикс падения при отсутствии атрибутов\nДобавил проверку на наличие аттача перед генерацией превьюшки\n"
                },
                {
                    "name": "a028f1a967",
                    "value": "anisimov.v :: Фикс лага при вводе пин кода\n"
                },
                {
                    "name": "3122b0d6b1",
                    "value": "anisimov.v :: Версия приложения - 4.8.0\n"
                },
                {
                    "name": "43a90aee0d",
                    "value": "anisimov.v :: Перенёс libxslt в под\n"
                },
                {
                    "name": "More",
                    "value": "(+ 256)\n"
                }
            ],
            "startGroup": false,
            "text": "Changes By ars, sorokin.m, zelinskaya.a, anisimov.v",
            "title": "Commits"
        }
    ],
    "text": "[Succeeded - Проекты ОРДО / Executive Workspace iOS / 4.8.0 / Build and Deploy / ExecutiveWorkspace #4.8.0.2](http://ddsm-teamcity.digdes.com/viewLog.html?buildTypeId=ORDO_ExecutiveWorkspaceIOS_480_BuildAndDeploy_ExecutiveWorkspace&buildId=47601)",
    "themeColor": "008900"
}

@spyder007
Copy link
Owner

That's what I was afraid of.. if they are ok in the log files, then it could be that Microsoft's incoming web hooks don't like those characters coming in.

Would you be able to try a postman post to Microsoft with some test characters?

@anivaros
Copy link

anivaros commented Jul 2, 2019

I just checked same request via curl in terminal and all fine:

curl -X POST "https://outlook.office.com/webhook/..." -H "accept: text/plain" -H "Content-Type: application/json" -d "{\"@type\":\"MessageCard\",\"@context\":\"http://schema.org/extensions\",\"text\":\"[Succeeded - Проекты ОРДО / Executive Workspace iOS / 4.8.0 / Build and Deploy / ExecutiveWorkspace #4.8.0.2](http://ddsm-teamcity.digdes.com/viewLog.html?buildTypeId\u003dORDO_ExecutiveWorkspaceIOS_480_BuildAndDeploy_ExecutiveWorkspace\u0026buildId\u003d47601)\",\"themeColor\":\"008900\",\"sections\":[{\"activityImage\":\"https://raw.githubusercontent.com/spyder007/teamcity-msteams-notifier/master/docs/TeamCity72x72.png\",\"activityTitle\":\"ExecutiveWorkspace\",\"startGroup\":false,\"facts\":[{\"name\":\"Branch\",\"value\":\"releases/release-4.8.0\"},{\"name\":\"Triggered by\",\"value\":\"Anisimov Vasiliy\"},{\"name\":\"Agent\",\"value\":\"ordo-ios-build-agent\"},{\"name\":\"Elapsed\",\"value\":\"5m:33s\"}]},{\"title\":\"Commits\",\"text\":\"Changes By ars, sorokin.m, zelinskaya.a, anisimov.v\",\"startGroup\":false,\"facts\":[{\"name\":\"bfefeb23ee\",\"value\":\"anisimov.v :: Включил локальные уведомления о новых документах для СОГАЗа\n\"},{\"name\":\"633e3b3625\",\"value\":\"anisimov.v :: Фикс падения при отсутствии атрибутов\nДобавил проверку на наличие аттача перед генерацией превьюшки\n\"},{\"name\":\"a028f1a967\",\"value\":\"anisimov.v :: Фикс лага при вводе пин кода\n\"},{\"name\":\"3122b0d6b1\",\"value\":\"anisimov.v :: Версия приложения - 4.8.0\n\"},{\"name\":\"43a90aee0d\",\"value\":\"anisimov.v :: Перенёс libxslt в под\n\"},{\"name\":\"More\",\"value\":\"(+ 256)\n\"}]}]}"

Screenshot 2019-07-02 at 20 06 38

@spyder007
Copy link
Owner

Ok, perhaps it's something with the mechanism in the plugin that is making the post.. I'll assign this to myself to test.

@spyder007 spyder007 self-assigned this Jul 2, 2019
@santiquetzal
Copy link

Similar problem in spanish: á é í ó ú ñ

image

TeamCity running on Docker over Windows 10 with linux containers.
Microsoft Teams running on Windows 10.

@elkhovd
Copy link

elkhovd commented May 28, 2021

@anivaros Did you find the solution?

@anivaros
Copy link

@anivaros Did you find the solution?

Yes, I've quit the company and don't use Teams anymore

hotelcostes added a commit to hotelcostes/teamcity-msteams-notifier that referenced this issue Apr 18, 2023
httppost.entity.contentType
text/plain; charset=ISO-8859-1
to
text/plain; charset=UTF-8
hotelcostes added a commit to hotelcostes/teamcity-msteams-notifier that referenced this issue Apr 26, 2023
fix for issue spyder007#11, fix for issue spyder007#43

httppost.entity.contentType
text/plain; charset=ISO-8859-1
to
text/plain; charset=UTF-8
spyder007 pushed a commit that referenced this issue Apr 26, 2023
fix for issue #11, fix for issue #43

httppost.entity.contentType
text/plain; charset=ISO-8859-1
to
text/plain; charset=UTF-8
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

No branches or pull requests

5 participants